Thanks.@api.multi
@api.model
def invoice_validate(self):
customer_obj=self.env['res.partner']
customer_id=customer_obj.search([('id','=',self.partner_id.id)])
customer_line=customer_obj.browse(customer_id)
dd = {'policy_number': self.policy_no,}
customer_stat_add = customer_obj.write([customer_line.id],{
'customer_status': [(0, 0, dd)]
})
state_change = self.write({'state': 'open'})
return state_change, customer_stat_add
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
This question has been flagged
I solved the problem, was browsing in a wrong way:
@api.multi
def invoice_validate(self):
customer_obj=self.env['res.partner']
customer_id=customer_obj.search([('id','=',self.partner_id.id)])
customer_line=customer_obj.browse([customer_id.id])
dd = {
'policy_number': self.policy_no,
}
customer_stat_add = customer_line.write({'customer_status': [(0, 0, dd)]})
state_change = self.write({'state': 'open'})
return state_change, customer_stat_add
Hi Md. Tanzilul Hasan Khan,
Just try this, I hope this will work.
customer_line.write({'customer_status': [(0, 0, dd)]})
I already tried that, it gives another error: ValueError: "can't adapt type 'res.partner'" while evaluating u'invoice_validate()'
Omg, Please check with your values, which i thought in your "self.policy_no"...!
Value was right, browse was problem. I have posted below. Thanks :)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
6
Aug 19
|
60712 | ||
|
1
Feb 19
|
8664 | ||
|
1
Mar 21
|
1337 | ||
|
0
Oct 24
|
134 | ||
|
3
Jul 23
|
1048 |
@Md. Tanzilul Hasan Khan@ Can you show here? that error(trouble)...! This will help us to give a correct suggestion...
@Jo, the error is following: ValueError: "write() got multiple values for keyword argument 'context'" while evaluating u'invoice_validate()'
Value was right, browse was problem. I have posted below. Thanks :)