Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
In the folloing code i extend the model partnet in my custommodule. I want to set sequence number for the new field "kundennummer" on a partner. But in the vals of the model partner you can't find the new field "kundennummer", so the method create doesn't work! What should i do?
kundennummer=fields.Char(required=True, copy=False, readonly=True, index=True, default=lambda self: _('New'))
string="Attended Sessions", readonly=True)
def create(self, vals):
vals['function']=self.env['ir.sequence'].next_by_code('code') or 'New'
if vals.get('kundennummer', 'New') == 'New':
vals['kundennummer'] = self.env['ir.sequence'].next_by_code('code') or 'New'
result = super(res_partner, self).create(vals)
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
|Asked: 4/18/16, 6:15 AM|
|Seen: 436 times|
|Last updated: 4/18/16, 6:56 AM|