odoo

Odoo 11 ValueError: Expected singleton: %s" % record

亡梦爱人 提交于 2019-12-24 19:10:14
问题 I am creating a custom module where I want to get all the selected employee in the Payroll and send them a default email. For that I am doing this To show the action button <?xml version="1.0" encoding="utf-8"?> <odoo> <data> <record id="action_email_payslip" model="ir.actions.server"> <field name="name">Email</field> <field eval="2" name="sequence"/> <field name="view_mode">form</field> <field name="multi" eval="False"/> <field name="model_id" ref="hr_payroll.model_hr_payslip"/> <field name=

Amount in text Odoo 10

空扰寡人 提交于 2019-12-24 18:47:06
问题 enter image description hereI want to convert the total amount showing in account invoice to word, please help. I could not solve it. Also I already tried to it but no luck 回答1: Did you want it in your report or for your record ? For Report In Odoo10 I usually do like this: <t t-esc="o.amount_total" t-esc-options='{"widget": "num2words","case":"capital"}'/> Here we have to install num2words module for its correct working. You can install it by pip install num2words or just google. 回答2: You

browse() method in odoo 8

坚强是说给别人听的谎言 提交于 2019-12-24 16:46:29
问题 In OperERP 7, There is a statement as context = dict(context or {}) data = self.read(cr, uid, ids, [], context=context)[0] In Odoo 8, I want to write this statement in new style. I tried the below, but it wont work. context = dict(self._context or {}) data = self.browse([], context)[0] Here how do I pass the context value ? 回答1: you can use with_context to change current environment's context. i.e. ctx = dict(self._context or {}) rec = self.with_context(ctx).browse() 来源: https://stackoverflow

How to refresh the original page after opening a URL in a new tab in OpenERP?

我是研究僧i 提交于 2019-12-24 16:37:02
问题 I have a button that opens a url in a new tab. I want the original page, where the button is, to be reloaded, refreshed, after the opening the url in the new tab. Is it possible to do it? Here is my XML code: <button name="test" type="object" string="Go!" attrs="{'invisible':[('flag_bom_present','=',False)]}" /> Here is my python code: def test(self, cr, uid, ids, context=None): res = { 'type': 'ir.actions.act_url', 'url': 'http://www.google.com' } return res 来源: https://stackoverflow.com

Picture in odoo qweb report

独自空忆成欢 提交于 2019-12-24 14:17:28
问题 I'd like show a picture in my qweb report. When I copy i.e. from the website_quote modul to my xml file this line: <img src="/website_quote/static/src/img/partner_icon_01.png"/> it works fine, but if I copy the partner_icon_01.png file to my module directory, and change the line: <img src="/my_module/static/src/img/partner_icon_01.png"/> , the picture doesn't appear in my report. Any help would be appreciated. Cheers: Janos 回答1: Try the following code and check <img class="img img-responsive"

odoo视图继承

為{幸葍}努か 提交于 2019-12-24 14:11:58
odoo视图继承 简介继承 在odoo里可以通过继承的方式来改写已经存在的view 对比view的定义视图定义中写法多了inherit_id inherit_id指向要改写的view <field name="inherit_id" ref="id_category_list"/> 在arch里用xpath定位改写的元素 <!-- 改写 ibuilding list 列表视图 --> <record id="building_list_view" model="ir.ui.view"> <field name="name">building.list.view</field> <field name="model">ibuilding.list</field> <field name="inherit_id" ref="building_list"/> <field name="arch" type="xml"> <!-- 找到ids字段,在其后添加idea_id字段 --> <xpath expr="//field[@name='ids']" position="after"> <field name="idea_id" string="Number of ideas"/> </xpath> <!-- 找到 upload 字段,在其后添加idea_ids字段 --> <xpath

Disable create and discard button for specific function in OpenERP

跟風遠走 提交于 2019-12-24 11:27:51
问题 I have been developing a module for OpenERP 7. I wanted to know that how can I disable create/delete button for a specific function. Like I am clicking on a button to open a tree view. All I want is to disable the create button form top of that tree view. How can I achieve this in OpenERP? I don't have any other ml view for this tree view. I am calling the only tree view. But this time I don't need the create/discard button. Can anyone guide me how to do this? I have a button named "my_views"

How to uninstall / update a module from command line odoo 11

依然范特西╮ 提交于 2019-12-24 10:49:56
问题 How can i uninstall / update a module from command line in odoo 11 ? i'm using ubuntu 16.04 . 回答1: To update module navigate to odoo folder which contains odoo-bin file then run command ./odoo-bin -u your_module -c /etc/your-odoo.conf To update all module you can use ./odoo-bin -u all -c /etc/your-odoo.conf you can also select which database by including -d database_name before -u in command 来源: https://stackoverflow.com/questions/56833832/how-to-uninstall-update-a-module-from-command-line

Odoo 11.0 modules: Missing dependencies: (2) [“web.form_relational”, “web.form_common”]

£可爱£侵袭症+ 提交于 2019-12-24 08:59:55
问题 I'm using the project_team module for my instance, and I'm getting this warning in the browser console: Non loaded modules: ["project_team.form_rel"] . Searching deep in the module i found that the origin of this problem in this: Missing dependencies: (2) ["web.form_relational", "web.form_common"] I could see that those modules are present in odoo 10.0 and it's not in 11.0. I think it requires an update, but i cannot find any information about how can we replace this two old modules in the

Dynamic domain does not work properly in odoo9

此生再无相见时 提交于 2019-12-24 08:04:39
问题 In Odoo9 I need a dynamic domain that depends on many2one field on a wizard. Using various examples I made it work, but the filtered values are always valid for previous option. Or they are valid if I choose an (invalid) option from the filtered domain. Details: At the end of opportunity workflow a salesman is supposed to evaluate opportunity where s/he chooses the probability of success. There were several levels to be chosen in special wizard ("100% sure", "not sure", "maybe" etc). I used