Can we draw table in openerp Project/task/description? - project

I need to create a table in a task, there is no place to do it except description in tasks,
but the problem is I can't find a toold to help me with it.
I tried once to create a table using simple lines like "_" and "|" but every time we want to add things to that table it is all messed up;
So is there a solution to add a table to some TASKS descriptions ?

You could create a simple module that overrides the description field of the task to use html. You'll need a model that inherits from project.task and redefines the description field like this:
_columns = {
'description': fields.html('Description')
}
Then you can use HTML tables in your task description. The downside is that people creating tables need to be familiar with HTML as you will have to write the HTML code by yourself, not using a table tool because the OpenERP HTML editor doesn't provide that option.

Related

How can we make an Item in socialengine?

I know how to get an item of the particular table. Like for user we can have
$userItem = Engine_Api::_()->getItem("user", $userId);
or for a custom table
$customItem = Engine_Api::_()->getItem("custom", $customeId);
I want to know the code or method how can I make my $customItem to work the same way as $userItem works for users table. So that I can get data or manipulate the data of custom table
Thanks for your help. :-)
You can achieve that by creating a model. Check how it's done in /application/modules/User/Model. There is User.php file that declares User_Model_User and methods available for User such as getTitle, get Href etc.
You may use similar approach for your custom item. You will also need to create a file similar to /application/modules/User/Model/DbTable/User.php to declare table for your custom items.

Custom naming of Aeroo report filename in Odoo

is there any way to get the report output from Aeroo named with a custom naming pattern?
I.e., for the invoice: [year]_[invoice number]...
#Raffaele, I'd recommend taking a look here and to this forum post.
You'll need to use some basic python logic in the report_custom_filename module to create the file name you need according to your requirements.
Using the following example I can create output for a filename for Sales Order/Quotation:
${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or '' +'.xls'}
That looks like this:
SO039_.xls
You can add another field from the document/report you're printing out by adding another section, for example:
${(object.client_order_ref or '').replace('/','_')}_
this will add the field client_order_ref in front of the document name like this:
[Here's your client order reference]_SO039.xls
Have a look at what fields are available in the model you're trying to get this information from (eg. in my case sale.order) and I think you'll find roughly what you need there.
I have still not figured out how to add a date/timestamp like you are requesting (eg. Year), however someone else may be able to offer some advice on this.

Adding new field on Odoo Product Variant

I am trying to add new field to product.product model.
What I've done so far is:
Add new field on the following model (From Settings > Database Structure > Models):
product.product
with the following details:
Name: x_product_cost
Field Label: Product Cost
Field Type: Float
and leave the rest to default.
The problem is i am unable to show it on the form. This is the only code that is generated when I tried to edit Form:
View Name: product.product.form
Object: product.product
Inherited View: product.template.common.form
Product Variant
lst_price
I can't use product.template model, since that inherits to product.product
Am i missing something here?
PS: I am trying to temporarily fixed assign-different-cost-on-product-variant bug as specified here
https://github.com/odoo/odoo/issues/1198
Can anyone help me with this?
Actually instead of modifying the model from the Odoo configuration, you should create a custom module, in which you will add the new fields and the new behaviors that you need.
To do so you will have to inherit from the models in the python files to extend them, and you will surely have to modify the views as well, so that your custom fields get displayed.
For reference on how to extend models, create a custom module and create the views, you should refer to the Odoo documentation that you can find here.
As an additional note in case you didn't know, but their is a new API that appeared in the version 8 of Odoo, if you can use it, it is much easier and much nicer.

How to display custom fields in rally?

I have a ruby script that is trying to pull up some custom fields from Rally, the filter works just fine ( the filter contains one of the custom fields i want to pull up) but when I try to display it, it doesn't show up in the list (the value returned for all custom fields is blank, while appropriate values are returned for FormattedID, Name, Description).
Here's the link [link]http://pastebin.ubuntu.com/6124958/
Please see this post.
Do you fetch the fields?
What version of WS API are you using? If it is v2.0 is c_ prepended to the name of the field in the code?
How is the field spelled in your code and how that spelling compares to Name and Display Name of the field in UI?
There is another reason why custom fields might not appear (other than the versioning and 'c_' issues nickm mentioned). I just found this out after a ton of head banging. The Rally SDK's ui stuff will filter out all fields that are hidden (such as _ref, or other 'hidden' custom fields) so you cannot view them in your apps in grids, charts, etc. For example, when constructing a Rally.ui.grid.Grid, a class called Rally.ui.grid.ColumnBuilder is constructed and it executes a command on the columns of the chart that look like this:
_removeHiddenColumns: function (columns) {
return _.filter(columns, function (column) {
return !column.modelField || !column.modelField.hidden;
});
},
As you can see, if you try to display any fields that are hidden (like _ref for example) in a grid, the column gets removed. So, although you may be fetching the custom fields, they will not show up unless those fields are not 'hidden'.

Limit selection choices

How do you limit selection options in a view? For instance account.voucher has 4 type options, but I want to display only two of them. How do you achieve that in a view definition?
If the selection is applied on a relation field (o2m, m2m) you can play with domains on the xml view itself. If the selection is actually a selection field I'm afraid you can't do this from XML.
You should be able to do that by overriding the fields_view_get (or fields_get can't remember right now). From there you can manipulate all the stuff you want but you'll have to handle python code and XML building.
grep "def $your_method_here" * into addons folder is your friend ;)
Use the domain attribute.
<field name="voucher_id" domain="[('type','in',['payment','receipt'])]"/>
This could also be done directly in the business object model:
_columns = {
'voucher_id': fields.many2one('account.voucher', 'Voucher',
domain="[('type','in',['payment','receipt'])]",
}