Odoo Help


Problems on extended module of the partners

Alessandro Lazzari
on 1/24/16, 5:12 AM 530 views

We have extended the module res.partner. We have added a field after the email, and added a method on_change on this new field. In the method on_change it create an instance of a TransientModel class, and when it make the method self.env['test.classì].create({}), odoo set to null the fields related to retail Accounting.
How to help me understand the reason of this behavior?


# -*- coding: utf-8 -*-
from openerp import models, fields, api
class res_partner(models.Model):
_inherit = 'res.partner'
test = fields.Char(string='Test')
def onchange_test(self):
p = self.env['test.class'].create({})
p.a = "test"

class test_class(models.TransientModel):
_name = "test.class"
a = fields.Char()
b = fields.Char()

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.


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)


Asked: 1/24/16, 5:12 AM
Seen: 530 times
Last updated: 1/24/16, 8:20 AM