add contexual field to invoice form and copy value from sales if available
This commit is contained in:
@@ -1 +1,2 @@
|
||||
from . import sale_order_contextual
|
||||
from . import account_move
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountMoveContextual(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
contextual_note = fields.Text(
|
||||
string='Contextuele opmerking',
|
||||
)
|
||||
@@ -7,3 +7,9 @@ class SaleOrderContextual(models.Model):
|
||||
contextual_note = fields.Text(
|
||||
string='Contextuele opmerking',
|
||||
)
|
||||
|
||||
def _prepare_invoice(self):
|
||||
vals = super()._prepare_invoice()
|
||||
if self.contextual_note:
|
||||
vals['contextual_note'] = self.contextual_note
|
||||
return vals
|
||||
|
||||
Reference in New Issue
Block a user