diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 7fd2fa814d0..3e192dd21d1 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -38,6 +38,15 @@ _logger = logging.getLogger(__name__) MAX_HASH_VERSION = 3 +PAYMENT_STATE_SELECTION = [ + ('not_paid', 'Not Paid'), + ('in_payment', 'In Payment'), + ('paid', 'Paid'), + ('partial', 'Partially Paid'), + ('reversed', 'Reversed'), + ('invoicing_legacy', 'Invoicing App Legacy'), +] + TYPE_REVERSE_MAP = { 'entry': 'entry', 'out_invoice': 'out_refund', @@ -444,14 +453,7 @@ class AccountMove(models.Model): exportable=False, ) payment_state = fields.Selection( - selection=[ - ('not_paid', 'Not Paid'), - ('in_payment', 'In Payment'), - ('paid', 'Paid'), - ('partial', 'Partially Paid'), - ('reversed', 'Reversed'), - ('invoicing_legacy', 'Invoicing App Legacy'), - ], + selection=PAYMENT_STATE_SELECTION, string="Payment Status", compute='_compute_payment_state', store=True, readonly=True, copy=False, diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 59eae586c8d..19e19eb7b0d 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from odoo import models, fields, api +from odoo.addons.account.models.account_move import PAYMENT_STATE_SELECTION from functools import lru_cache @@ -32,11 +33,7 @@ class AccountInvoiceReport(models.Model): ('posted', 'Open'), ('cancel', 'Cancelled') ], string='Invoice Status', readonly=True) - payment_state = fields.Selection(selection=[ - ('not_paid', 'Not Paid'), - ('in_payment', 'In Payment'), - ('paid', 'paid') - ], string='Payment Status', readonly=True) + payment_state = fields.Selection(selection=PAYMENT_STATE_SELECTION, string='Payment Status', readonly=True) fiscal_position_id = fields.Many2one('account.fiscal.position', string='Fiscal Position', readonly=True) invoice_date = fields.Date(readonly=True, string="Invoice Date")