mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Store total field on payment orders
This commit is contained in:
@@ -35,6 +35,12 @@ class PaymentOrder(models.Model):
|
||||
readonly=True, states={'draft': [('readonly', False)]})
|
||||
mode_type = fields.Many2one('payment.mode.type', related='mode.type',
|
||||
string='Payment Type')
|
||||
total = fields.Float(compute='_total', store=True)
|
||||
|
||||
@api.depends('line_ids', 'line_ids.amount')
|
||||
@api.one
|
||||
def _total(self):
|
||||
self.total = sum(self.mapped('line_ids.amount') or [0.0])
|
||||
|
||||
@api.multi
|
||||
def launch_wizard(self):
|
||||
|
||||
Reference in New Issue
Block a user