diff --git a/models/acc_account.py b/models/acc_account.py index aa3abed433f6c6f91fe82c054e169e80ebda3f5c..f7055d7cc8cecd3b5ce5b6f02322c81d1ca5095b 100644 --- a/models/acc_account.py +++ b/models/acc_account.py @@ -108,6 +108,11 @@ class AccAccount(models.Model): "Consommation locale (index Enedis)", digits="Unité de Mesure" ) url = fields.Char("URL", compute="_compute_url", store=True) + state = fields.Selection(selection=[ + ('draft', 'Brouillon'), + ('published', 'Publié'), + ], string='Statut', required=True, copy=False, tracking=True, + default='draft') @api.model_create_multi def create(self, vals_list): diff --git a/views/acc_account_views.xml b/views/acc_account_views.xml index 9ee6353110dcc1cfc1dbd2ba592111c45036133a..1fa88685d34d4c9cdf05af0abd4e11c6a400d071 100644 --- a/views/acc_account_views.xml +++ b/views/acc_account_views.xml @@ -191,10 +191,10 @@ <field name="model">acc.account</field> <field name="arch" type="xml"> <form string="Facture"> + <header> + <field name="state" widget="statusbar" options="{'clickable': '1'}" statusbar_visible="draft,published"/> + </header> <sheet> - <!-- Payment status for invoices / receipts --> -<!-- <widget name="web_ribbon" title="Paid"/>--> - <!-- Invisible fields --> <field name="id" invisible="1" /> <div class="oe_title">