1
我已經創建了一個客戶表單。所以,當我驗證(按鈕驗證)發票時,我試圖傳遞一些值。我嘗試了很多方法並遵循odoo論壇,但是我很難做到這一點。使用下面的代碼: 我one2many領域是 'res.partner' customer_status「:如何從會計發票更新客戶中的one2many
@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
它給我這個錯誤:
ValueError: "invoice_validate() takes exactly 2 arguments (1 given)" while evaluating
u'invoice_validate()'
感謝。