odoo-8

Odoo - prevent button from closing wizard

送分小仙女□ 提交于 2020-01-10 14:16:22
问题 I have a transient model that serves as a dialog. In my form view I have a button like this: <footer states="partnerId"> <button name="check_tax_id" string="Tovább" type="object"/> </footer> The button invokes this function (I can confirm it actually invokes): @api.one def check_tax_id(self, context=None): self.state = "partnerDetails" return None; My problem is that the dialog window is closed immediately once I click this button! What am I doing wrong? 回答1: Solution 0 @api.multi def check

how can i use function value in Domain filter

断了今生、忘了曾经 提交于 2020-01-06 15:25:16
问题 I am getting current login user id by following function def _get_user_name(self, cr, uid, *args): user_obj = self.pool.get('res.users') user_value = user_obj.browse(cr, uid, uid) return user_value.id or False and now i want to use its value in this field's Domain like .... x_trainer_id = fields.Many2one('res.partner', string='Trainer',domain=[('user_id.id','=','get_user_name')]) How is it possible? I'll be very thankful.... 回答1: you can do it as below: x_trainer_id = fields.Many2one('res

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

Javascript - call super on parents parent?

☆樱花仙子☆ 提交于 2020-01-04 05:30:31
问题 I have defined this extension of current custom javascript view in Odoo: openerp.account_move_journal_test = function(instance){ var _t = instance.web._t, _lt = instance.web._lt; var QWeb = instance.web.qweb; instance.web.account.QuickAddListView.include({ init: function(){ this._super.apply(this, arguments); console.log("QuickAddListView modified init") }, }); }; Now for better representation I added console log in QuickAddListView and in ListView , which are parents that are called using

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

Odoo : Acces a column from many2one

ぃ、小莉子 提交于 2020-01-03 03:59:06
问题 Here is my problem : I'm in model1 : class model1(osv.osv): _name = 'model1' _columns = { 'name': fields.many2one('res.partner', u'Person', domain=[('my_boolean', '=', False)], required=True, select=True), 'type' = fields.selection([('1', 'One'), ('2', 'Two'), u'Select', required=True), } @api.onchange('type') def onchange_type_model1(self) self.name.model3_id = 2 And I want to modify in this onchange the value of the id of model3_id in res.partner: -res.partner in this module: class res

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

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

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

爱⌒轻易说出口 提交于 2020-01-02 11:00:08
问题 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