Odoo Help

0

Save of many2one fields problem

By
Dmitry
on 4/29/13, 1:40 AM 1,277 views

Hello, I have the following code for improve mrp_repair (7.0-20130307-002146):

from openerp.osv import osv, fields
from openerp.tools.translate import _

class a_repair(osv.osv):
    _name = 'mrp.repair'
    _inherit = 'mrp.repair'

    _columns = {
        'user_id': fields.many2one('res.users', 'Repairer', translate=True),
        'complete_name': fields.many2one('account.analytic.account', 'Contract', translate=True),
    }
a_repair()

and:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
       <record id="view_repair_order_form" model="ir.ui.view">
       <field name="name">mrp.repair.form.inherit</field>
       <field name="model">mrp.repair</field>
       <field name="inherit_id" ref="mrp_repair.view_repair_order_form" />
       <field name="arch" type="xml">
           <field name="address_id" position="after">
          <field name="user_id"/>
          <field name="complete_name"/>
           </field>
         </field>
    </record>

    </data>
</openerp>

with additional simple fields. When I create new record, I can success to set and to save all fields, but when I try to change and to save user_id and/or complete_name fields (early saved), in result these fields are empty. Another simple fields are saved. Could you recommend how to save user_id and complete_name fields or solution for insert user and contract to repair form?

Thank you for advice!

in which version of openerp you are using

Maniganda
on 4/30/13, 12:00 PM

Hello, I use OpenERP 7 (7.0-20130307-002146).

Dmitry
on 5/6/13, 9:52 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/29/13, 1:40 AM
Seen: 1277 times
Last updated: 3/16/15, 8:10 AM