odoo-11

Javascript code doesn't work in odoo.define but works in developer console

匆匆过客 提交于 2021-02-11 14:54:40
问题 As the pic down below, I want make background-color change when a radio value is changed. this is for ODOO11. I've set js file for template to inherit. but it doesn't work. <template id="assets_backend_weight" name="static_resources_demo assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/yc_root/static/src/js/my_js.js"></script> </xpath> </template> my_js.js odoo.define('yc_root.my_JS', function (require) {"use strict"; var Class =

Javascript code doesn't work in odoo.define but works in developer console

♀尐吖头ヾ 提交于 2021-02-11 14:51:26
问题 As the pic down below, I want make background-color change when a radio value is changed. this is for ODOO11. I've set js file for template to inherit. but it doesn't work. <template id="assets_backend_weight" name="static_resources_demo assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/yc_root/static/src/js/my_js.js"></script> </xpath> </template> my_js.js odoo.define('yc_root.my_JS', function (require) {"use strict"; var Class =

How to send mail automatically while creating new vendor bill or customer invoice in odoo

喜你入骨 提交于 2021-02-11 12:28:57
问题 Hello everyone I have a custom accounting module inherits from odoo accounting module. I have created a budget and a budget has someone responsible for, and an analytic account related to this budget. I want to create vendor bills and customer invoices based on an analytic account related to the specific budget and I want to send an email notification message to the person responsible for the budget in his email when I create a new bill or invoice to notify him that with a message ( new bill

create complicated domain for my attrs attribute

[亡魂溺海] 提交于 2021-02-10 16:43:47
问题 I want to build below logic for my attrs . Can some help me here ? A OR B OR ( C OR ( (D AND E) OR (F AND G AND H) ) ) I tried with below logic ['|','|', (A), (B),'|'(C), '|','&', (D), (E),'&', (F),'&' (G),(H)] 回答1: It can be quite tricky to form such domains. In those cases you can use odoo.osv.expression helpers, which take a list of domains ( not a list of leafs). Example: >>> from odoo.osv.expression import AND, OR >>> a,b,c,d,e,f,g,h = ([("field_" + x, "=", "value_" + x)] for x in

create complicated domain for my attrs attribute

淺唱寂寞╮ 提交于 2021-02-10 16:40:09
问题 I want to build below logic for my attrs . Can some help me here ? A OR B OR ( C OR ( (D AND E) OR (F AND G AND H) ) ) I tried with below logic ['|','|', (A), (B),'|'(C), '|','&', (D), (E),'&', (F),'&' (G),(H)] 回答1: It can be quite tricky to form such domains. In those cases you can use odoo.osv.expression helpers, which take a list of domains ( not a list of leafs). Example: >>> from odoo.osv.expression import AND, OR >>> a,b,c,d,e,f,g,h = ([("field_" + x, "=", "value_" + x)] for x in

How to develop (run and debug) modules in Odoo v11 on Visual Studio Code in Ubuntu?

99封情书 提交于 2021-02-06 13:53:24
问题 Is it possible to run and debug Odoo on Visual Studio Code? If yes please share me the configuration. Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring. It is free and open-source, although the official download is under a proprietary license. 回答1: I know I'm a bit late but I have managed to work with Odoo 11.

How to develop (run and debug) modules in Odoo v11 on Visual Studio Code in Ubuntu?

大憨熊 提交于 2021-02-06 13:49:16
问题 Is it possible to run and debug Odoo on Visual Studio Code? If yes please share me the configuration. Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring. It is free and open-source, although the official download is under a proprietary license. 回答1: I know I'm a bit late but I have managed to work with Odoo 11.

How to organize many2many checkboxes in lines (rows) rather than columns?

独自空忆成欢 提交于 2021-01-28 03:03:03
问题 I am creating one module where I have a Many2many field and I would like to convert it into a checkbox group. I have written this in my XML view to achieving it <field name="location_ids" widget="many2many_checkboxes"/> But the field is shown all the options in a long column. I would like to show the options in multiple rows as in the following image: 回答1: I think I have found a good approach for you. Research First I have search the original template which is rendered with the widget

How to organize many2many checkboxes in lines (rows) rather than columns?

我的未来我决定 提交于 2021-01-28 00:47:43
问题 I am creating one module where I have a Many2many field and I would like to convert it into a checkbox group. I have written this in my XML view to achieving it <field name="location_ids" widget="many2many_checkboxes"/> But the field is shown all the options in a long column. I would like to show the options in multiple rows as in the following image: 回答1: I think I have found a good approach for you. Research First I have search the original template which is rendered with the widget

error while launching qweb report from python

梦想与她 提交于 2021-01-27 11:50:38
问题 I'm upgrading a module from odoo v10 to odoo v11. It is founded that the get_action is replaced with report_action. so I used the code as follows self.env.ref('report_action_name').report_action(self, data=data, config=False) but it gives me error AttributeError: 'ir.ui.view' object has no attribute 'report_action' Thanks in advance 回答1: Make sure that report_action_name is the record_id of the report . Eg: Python self.env.ref('module_name.record_id').report_action(self, data=data, config