odoo

Odoo How to create a new model for Product Master with all the data in the product master

徘徊边缘 提交于 2020-01-06 06:01:07
问题 I want to create a separate view for Product Master.I created a new model and tried like this.But when I checked in database no data is present in my new model. Code class QuotationCreation(models.Model): _name='quotation.creation' xn_product_id = fields.Many2one('product.template') product=fields.Char(related = 'xn_product_id.name',string='Product') How can I tranfer all the data from product master to this model. I want to create a new model with existing data.How can I do that ? Thanks in

How to get computed field value in search orm in odoo

[亡魂溺海] 提交于 2020-01-06 05:42:46
问题 I have defined a computed field with compute method in odoo 10 and now i want to get its value in search orm but its value remain False, and when I tried store=True its value not being changed. if anyone has solution please let me know, I'll highly thankful. My code is: balance_amount = fields.Float(string="Balance Amount", compute='_compute_loan_amount') @api.one def _compute_loan_amount(self): total_paid = 0.0 for loan in self: for line in loan.loan_lines: if line.paid: total_paid += line

Can anyone explain me the rules' behaviour in Odoo?

筅森魡賤 提交于 2020-01-06 04:03:43
问题 I'm, as always, stuck with rules, since I'm not able to understand them yet. This is what we're said: Interaction between rules Global rules (non group-specific) are restrictions, and cannot be bypassed. Group-local rules grant additional permissions, but are constrained within the bounds of global ones. The first group rules restrict further than global rules, but any additional group rule will add more permissions. Detailed algorithm: 1. Global rules are combined together with a logical AND

I can't find my module in Odoo

那年仲夏 提交于 2020-01-04 05:41:32
问题 I have created a module in Odoo 8 following a tutorial. I activated the technical features in Users then I've updated the module list but it doesn't appear in the list. What should I do ? 回答1: Track the following: checkout __init__.py , __openerp__.py files weather any server track-back appear or not find the path of addons module is your module is at same place or path? give read/write/execute permission for that module restart your server Go to browser, from GUI, Setting => Modules =>

What is wrong with following code in Python?

别来无恙 提交于 2020-01-04 02:12:20
问题 I was trying to implement a constraint for a field but instead of causing a constraint validation, it allows the record to get saved without showing any constraint message def _check_contact_number(self, cr, uid, ids, context=None): for rec in self.browse(cr, uid, ids, context=context): if rec.contact_number: size=len(str(rec.contact_number)) if size<10: return False if not contact_number: return {} contact_number = rec.contact_number.replace('.','') #removes any '.' from the string contact

Add the new Dynamic Field in Odoo

限于喜欢 提交于 2020-01-03 03:50:42
问题 Is it possible to add new field based on View in Postgresql in Odoo without using Odoo model class file. ? 回答1: You can get have a model getting it's data from a view. In fact that's widely used by reports. But the field list available needs to defined in the model. 回答2: for creating dynamic views in odoo, you better refer this link Here is the solution Specify the parameter _auto=False to the OpenERP object, so no table corresponding to the _columns dictionary is created automatically. Add a

onchange functions on boolean fields in odoo 8

孤者浪人 提交于 2020-01-02 12:16:01
问题 i would like to know how onchange function works with boolean and integer fields. Suppose if one boolean field get changed to True, the value of respective integer should be changed. Thanks in advance. 回答1: @api.onchange This decorator will trigger the call to the decorated function if any of the fields specified in the decorator is changed in the form: @api.onchange('fieldx') def do_stuff(self): if self.fieldx == x: self.fieldy = 'toto' In previous sample self corresponds to the record

onchange functions on boolean fields in odoo 8

百般思念 提交于 2020-01-02 12:14:23
问题 i would like to know how onchange function works with boolean and integer fields. Suppose if one boolean field get changed to True, the value of respective integer should be changed. Thanks in advance. 回答1: @api.onchange This decorator will trigger the call to the decorated function if any of the fields specified in the decorator is changed in the form: @api.onchange('fieldx') def do_stuff(self): if self.fieldx == x: self.fieldy = 'toto' In previous sample self corresponds to the record

How can I delete the “sheet” node keeping its content intact?

谁说胖子不能爱 提交于 2020-01-02 11:03:50
问题 I would like to remove the node <sheet></sheet> from a form view. For instance, I have this view: <record id="view_account_period_form" model="ir.ui.view"> <field name="name">account.period.form</field> <field name="model">account.period</field> <field name="arch" type="xml"> <form string="Account Period"> <header> [...] </header> <sheet> <group> <group> <field name="name"/> <field name="fiscalyear_id" widget="selection"/> <label for="date_start" string="Duration"/> <div> <field name="date

How can I delete the “sheet” node keeping its content intact?

元气小坏坏 提交于 2020-01-02 11:00:49
问题 I would like to remove the node <sheet></sheet> from a form view. For instance, I have this view: <record id="view_account_period_form" model="ir.ui.view"> <field name="name">account.period.form</field> <field name="model">account.period</field> <field name="arch" type="xml"> <form string="Account Period"> <header> [...] </header> <sheet> <group> <group> <field name="name"/> <field name="fiscalyear_id" widget="selection"/> <label for="date_start" string="Duration"/> <div> <field name="date