Community mailing list archives

Having trouble to pass value in an one2many field

Md. Tanzilul Hasan Khan
- 02/29/2016 12:33:26

I have created an one2many to customer form. So, when I am validating (button validate) an invoice I am trying to pass some values in that one2many. I have tried many ways and followed odoo forums, but I am having trouble to do that. Using following code:

My one2many field is 'customer_status' in 'res.partner' :
def invoice_validate(self):

customer_stat_add = customer_obj.write(customer_id,
{'customer_status': [(0, 0,
{'policy_start': self.date_invoice,
state_change = self.write({'state': 'open'})
return state_change, customer_stat_add
Any help will be appreciated.

Best Regards,
MD. Tanzilul Hasan Khan.