Hi,
When I click on "SAVE" event to create a record in my object, my field values are also used to create a record in other object.
Also my requirement doesnt go well with _inherits of other object.
Thanks & Regards,
Atchuthan
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
When I click on "SAVE" event to create a record in my object, my field values are also used to create a record in other object.
Also my requirement doesnt go well with _inherits of other object.
Thanks & Regards,
Atchuthan
Hello,
class test1(osv.osv): _name = 'test1'
class test(osv.osv):
_name = 'test'
def create(self, cr, uid, vals, context=None):
att_id = self.pool.get('test1').create(cr, uid, {'key':value}, context=context)
res = super(test, self).create(cr, uid, vals, context=context)
return res
Here, 'test' & 'test1' are two objects. I have written a create() in 'test', When we create a record for this object it will create record for 'test1' as we have written self.pool.get('test1').create(cr, uid, {'key':value}, context=context).
we have to pass a dictionary of 'Key' & of it's value.
Thank you.
Don't hesitate to mark as "correct" the answer. That will be helpful for future search.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Write def create() for this.
@Hiral Patel
def create() is used only to provide the values to be set at the time of create for my object
but my requirement is to create a record of other object
If we can use create() ORM method, give me in detail