odoo-10

How to modify the one2many or many2one field in other model odoo10

北城以北 提交于 2019-12-25 17:46:10
问题 Can any one tell with example how to modify the field in another model if changed in type-one2many field. For example, I have two models a) hr_shifts b)hr_contract in hr_shifts there is one2many field(emp_name_ids) when changed in this fields reflect in hr_contract after click on save button. this code work, but when I used in one2many field (emp_name_ids) it doesn't work @api.depends('schedule') def _onchange_schedule(self): for item in self.hr_shifts_line: current=self.env['hr.contract']

Odoo 10 view inherit error:

醉酒当歌 提交于 2019-12-25 09:07:03
问题 I am trying to override view of task' timesheets tab in project. Here are new module view.xml: <record id="view_project_task_form_materials" model="ir.ui.view"> <field name="name">project.task.form.materials</field> <field name="model">project.task</field> <field name="inherit_id" ref="view_sale_service_inherit_form2"/> <field name="arch" type="xml"> <xpath expr="//field[@name='timesheet_ids']/ancestor::page" position="after"> <page name="materials_used" string="Materials" groups="project

How to bypass ODOO security rules given by administrator?

六眼飞鱼酱① 提交于 2019-12-25 01:52:59
问题 how to view settings which is not allowed to view for users in ODOO, for studying purpose only i.e., how to bypass the access rights 回答1: Simply you cannot this is a framework develloped with qualified community. If you can do that why use it at all!!!? The security in odoo is one of the things that make odoo, in the top framewoK league. 来源: https://stackoverflow.com/questions/47193832/how-to-bypass-odoo-security-rules-given-by-administrator

Create Record Error

此生再无相见时 提交于 2019-12-24 19:26:43
问题 HI any help please I have this code odoo 10 ,I try to create a one2many relation history_line the first class class db_backup_ept(models.Model): _name = 'db.autobackup.ept' name = fields.Char('Database', size=100, required='True',help='Database you want to schedule backups for') host = fields.Char('Host', size=100, required='True', default='localhost') port = fields.Char('Port', size=10, required='True', default='8069') history_line = fields.One2many('db.backup.line', 'backup_id', 'History',

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

How to preview images after uploading in Odoo V10?

陌路散爱 提交于 2019-12-24 09:57:02
问题 There is ir.attachment model available for uploading URL and files but I want to upload images and that can be viewed on the uploading form UI-view. Is there any way I can do it as I haven't found anything on this related to Odoo V10. How can we solve this issue? 回答1: odoo app available on odoo apps page please go throw this url may be it will help you [https://apps.odoo.com/apps/modules/category/Extra%20Tools/browse?search=image+preview] if this helped you please up-vote my answer 回答2: You

Odoo10 Javascript Widget action not working: ClientWidget is not a function

回眸只為那壹抹淺笑 提交于 2019-12-24 09:37:08
问题 I'm still learning how to properly add your own javascript code. I'm trying to add my own stuff into Odoo backend. I was carefully reading "Building Interface Extensions" guide (https://www.odoo.com/documentation/10.0/howtos/web.html), but it is ether badly inaccurate or completely outdated. After looking at Odoo official modules like Account, Project, CRM I've coded something like this: odoo.define('rhp.main', function (require) { "use strict"; var core = require('web.core'); var _t = core.

How to pass value with onchange one2many variable in odoo?

爱⌒轻易说出口 提交于 2019-12-24 08:47:08
问题 <field name="salary_month"/> <field name="earning_type_id"> <tree editable="bottom"> <field name="earnings_type" /> <field name="based_on" on_change="calc_amount(based_on,salary_month)" /> <field name="amount" /> <field name="total" /> </tree> </field> In the above condition I have two variables one is salary_month another one is one2many variable earning_type_id . While on change inside earning_type_id I need to pass the value of salary_month . Its shows undefined variable salary_month .

Show to be deleted items in popup window

柔情痞子 提交于 2019-12-24 03:19:23
问题 I am using Odoo 10e. I want a simple functionality that whenever i wanted to delete one or more then one item from a list view or from a specific list view only. I want to show all of the items which are selected for deleted to show their name in popup window so that user can have a quick review what's he is going to delete. I know user can see details in list view but i want to give a glimpse to user in shape of model window that this is going to be deleted. Are you sure to delete ? If user

Odoo 10: Open a form view in an editable tree view

耗尽温柔 提交于 2019-12-24 02:58:11
问题 I am creating a new model in Odoo 10. This model is accessed through a menu item which launches tree view. Tree view is editable but I would like to be able to launch form view for the specific record user is editing if user wants to. Is there any option to either put a button in the tree view to launch the form view or something? Could someone highlight the steps required or point to a similar code example? Thanks, 回答1: using a buttons : in tree view: <tree editable="top"> ... ... <button