fix issue with blue
This commit is contained in:
parent
5c4082ab75
commit
62e3f8cc9b
|
|
@ -18,6 +18,20 @@ class AccountMove(models.Model):
|
|||
else:
|
||||
self.purpose = ''
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
moves = super(AccountMove, self).create(vals_list)
|
||||
for move in moves:
|
||||
if move.purchase_id:
|
||||
move.purpose = move.purchase_id.purpose
|
||||
return moves
|
||||
|
||||
def write(self, vals):
|
||||
if vals.get('purchase_id'):
|
||||
po = self.env['purchase.order'].browse(vals['purchase_id'])
|
||||
vals['purpose'] = po.purpose
|
||||
super(AccountMove, self).write(vals)
|
||||
|
||||
class PurchaseOrderCustom(models.Model):
|
||||
_inherit = "purchase.order"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue