Browse Source

Merge PR #519 into 12.0

Signed-off-by legalsylvain
pull/537/head
OCA-git-bot 4 years ago
parent
commit
12cbabfea4
  1. 13
      pos_payment_change/wizards/pos_payment_change_wizard_new_line.py
  2. 14
      pos_payment_change/wizards/pos_payment_change_wizard_old_line.py

13
pos_payment_change/wizards/pos_payment_change_wizard_new_line.py

@ -20,7 +20,18 @@ class PosPaymentChangeWizardLine(models.TransientModel):
domain=lambda s: s._domain_new_journal_id(),
)
amount = fields.Float(string="Amount", required=True)
company_currency_id = fields.Many2one(
comodel_name='res.currency', store=True,
related='new_journal_id.currency_id',
string="Company Currency", readonly=True,
help='Utility field to express amount currency'
)
amount = fields.Monetary(
string="Amount",
required=True, default=0.0,
currency_field='company_currency_id'
)
@api.model
def _domain_new_journal_id(self):

14
pos_payment_change/wizards/pos_payment_change_wizard_old_line.py

@ -20,4 +20,16 @@ class PosPaymentChangeWizardOldLine(models.TransientModel):
readonly=True,
)
amount = fields.Float(string="Amount", required=True, readonly=True)
company_currency_id = fields.Many2one(
comodel_name='res.currency', store=True,
related='old_journal_id.currency_id',
string="Company Currency", readonly=True,
help='Utility field to express amount currency'
)
amount = fields.Monetary(
string="Amount",
required=True,
readonly=True, default=0.0,
currency_field='company_currency_id'
)
Loading…
Cancel
Save