Odoo Help

Welcome!

This community 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.

0

Problems on extended module of the partners

By
Alessandro Lazzari
on 1/24/16, 5:12 AM 265 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?

code: 

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

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


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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