I have added some custom fields to the model account.move and I want to add these fields in the following Odoo Enterprise reports:
Accounting/Reporting/Partner ledger
Accounting/Reporting/Aged receivable
Accounting/Reporting/Aged payable
I did not find how to add fields to this kind of reports and they are way different than the regular views
Have a look at the official odoo documentation for qweb reports.
It looks roughly like this:
<t t-inherit="base.template" t-inherit-mode="extension">
<xpath expr="//tr[1]" position="after">
<tr><td>new cell</td></tr>
</xpath>
</t>
Set t-inherit-mode="extension" to modify an existing template. If you would set it to primary you would create a new template. From there on you can work with the familiar odoo xpath logic.
Keep in mind that this is a templating language with python support. So to actually print a field you first need to find the variable in the parent report (the mother recordset is usually called doc, order or something like this depending on the report). To display it you would do something like this:
<p><t t-out="order.name"/></p>
Also make sure to open the correct version of the documentation. There have been some changes to reports in recent versions.
Related
This is with Odoo 10 and the default bootstrap-datetimepicker.
I have a field in my view that has a "Start of event" datetime. I'd like the date picker that shows up to work in 5 minute intervals (minuteStepping: 5) and to show the time picker along with the date picker (sideBySide: true).
I've confirmed that this works as I want it to by editing addons/web/static/src/js/widgets/date_picker.js manually.
However, I'd prefer to just give the two options I want to change as a parameter to my <field ..> definition under my <form> tag in the view XML. The source Widget accepts an options parameter in its init method that it extends to end up with the final options object, but I've been unable to insert my configuration options into this object.
I tried giving it as <field ... options="{...}" and as .. t-field-options='..', but I'm guessing the latter won't work since I'm not in a qweb context in my view, and the first one isn't read by widgets.
Is there any way I can do this without creating a new widget? (and hopefully without subclassing or extending the existing widget, but keep it as a pure view configuration option instead)?
You can see a great example in this module. https://github.com/OCA/web/tree/10.0/web_m2x_options
In the file. static/src/js/form.js.
The module has overridden the fields Many2one to add different options can be set in the XML declaration of field.
Example : <field name="partner_id" options="{'search_more':true}" />
In this example. The search more button is visible in all cases.
You can use the logic of this module as a base of your widget extension.
Installation:
In a First time, you must download the Github repository.
https://github.com/jo541/web
Select the branch 10.0.
In the repository, there are a named module "web_widget_datepicker_options". This module gives you the possibility to specify any options as you want for a specific field.
After download and install the module on Odoo. You needing to reload the cache of your browser to be sure.
Modification:
Now you can modify your form view. For an example, I will use the view form sale.order.
In the form view sale.order, you have a field "date_order". If you would like to have the time step 5 by 5.
<field name="date_order" options="{'datepicker':{'minuteStepping': 5}}" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
All the options in the dict of the key datepicker will be adding to the option of the bootstrap datepicker.
I have to add an item in print menu from purchase order tree view in odoo 8.
i am unable to find where is current Purchase Order reports added in print menu. i researched and found there is a tag from below:
https://www.odoo.com/forum/help-1/question/how-to-add-an-item-to-the-more-drop-down-list-in-sales-module-61833
also tried below, but i am getting qweb error :
<act_window name="Print Receiving Wkst"
res_model = "purchase.order"
src_model = "purchase.order"
key = "action"
key2="client_print_multi"
value="ir.actions.act_window,action_report_print_receivePO"
id="act_print_recevg_wkst"
/>
my custom report is in "test" module with id "action_report_print_receivePO"
I am getting error for value tag i think.
Basically i have to add new entry in print menu from purchase order tree view. so that when ever it is clicked custom report is printed. moreover if more than one PO selected, it will create PDF of all the POs
Thanks,
You don't need to go through the stress of creating an action and then adding a new item to the "More dropdown". Odoo already provides a way for you do this. just set menu = True when you're registering your report and a Print option would appear in the "More dropdown" that prints your report.
<report
id="purchase_order_report"
string="Purchase order"
model="purchase.order"
report_type="qweb-pdf"
file="purchase.order.file"
name="purchase.order.report"
menu="True"
/>
For more information on what the other parameters mean please refer to the
docs
just in case you might want to generate reports of a different types not fully supported by Odoo, such as py3o you'll definitely need to create a report action as defined in the official doc. For example:
<record id="account.account_invoices" model="ir.actions.report">
<field name="report_type">py3o</field>
<field name="py3o_filetype">odt</field>
<field name="module">my_custom_module_base</field>
<field name="py3o_template_fallback">report/account_invoice.odt</field>
</record>
However for your action to appear in the Print dropdown list, you must add two more fields to the record
<field name="binding_model_id" ref="model_my_custom_module_base"/>
<field name="binding_type">report</field>
Hope this helps anyone in the future!!
NB: Here I'm using the py3o reporting engine. Check it out as an alternative to the native qweb engine.
Just i want to know is there any possibility to show the many2many_checkboxes in multiple lines?
For a field i have given like,
<field name="sports_ids" widget="many2many_checkboxes" options="{'no_create_edit': True}" nolabel="1"/>
Now, how can i show all the check boxes in 3 lines?
You can achieve this by creating new widget for many2many field.
Create static folder with js, css, xml
Add new widget to odoo
instance.web.form.widgets.add('many2many_mycheckboxes',
'instance.web.form.MyCheckBoxes');
And then create widget
Good luck
You can also give CSS style "column-count" for that particular field.
I have made read only computed URL-field based on invoice number. It works nicely but I would like to produce text part only itself like 400:
400
Now it's producing whole link as text which is quite ugly
https://external_site_invoice?num=400
My Odoo fields are defined this way...
ext_invoice_number= fields.Integer(string="Ext number")
def _showlink(self):
for rec in self:
if rec.ext_invoice_number:
if rec.ext_invoice_number>0:
rec.ext_link="https://external site/invoice?num=%d" % (rec.ext_invoice_number,)
ext_link = fields.Char(string="Link",compute=_showlink,)
How can I define text part of URL in Odoo to be different than link? This is poorly documented or it's not possible?
you can define the text attribute in widget definition like that:
<field name="field_with_url" widget="url" readonly="1" text="My own text"/>
Regards
Our TFS 2012 team project was migrated to a new TFS2013 server with all data.
When I now try to activate the new "Portfolio Backlog" feature the following error is presented:
[Error] TF400618: The reporting type of field
'Microsoft.VSTS.Common.StateChangeDate' in work item type 'Feature'
conflicts with the reporting type of the existing field
In Scrum 2.2 the type definitions of SharedStep and TestCase have this field definition
<FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
<WHENCHANGED field="System.State">
<SERVERDEFAULT from="clock" />
</WHENCHANGED>
<WHENNOTCHANGED field="System.State">
<READONLY />
</WHENNOTCHANGED>
</FIELD>
In the Scrum 3.0 additional the Feature has these field.
In the MSDN under TF400618: The reporting type of field '{0}' in work item type '{1}' conflicts with the reporting type of the existing field.
I'm not understanding what I need to do to resolve the issue with the feature field.
Do I need to manually alter the scrum 2.2 process template with the feature work item type , publish the changed process template into the team project and than activate the "Portfolio Backlog"?
Once you've modified your process template, TFS can't automatically install the new updates to it. Here's guidance on how to update it manually: http://msdn.microsoft.com/en-us/library/ms194972(v=vs.120).aspx
I recommend that you instead script your process template changes in a batch file so that when new versions come out, you can easily repeat your changes in the new template rather than going through the 12-step manual process above.
I wasn't able to configure Features after performing all the steps as mentioned in :http://msdn.microsoft.com/en-us/library/ms194972(v=vs.120).aspx
So I updated the Feature.xml such that the "State Change Date" FIELD name as a reportable option set to "dimentions"
After this change I updated the the default template to the one I had customized and was able to configure Features.
Here is how the updated code in Feature.xml looks:
<FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime" reportable="dimension" >