diff --git a/ext/custom-addons/dp_custom/__manifest__.py b/ext/custom-addons/dp_custom/__manifest__.py index dfe1a2f9..e8c5b54a 100644 --- a/ext/custom-addons/dp_custom/__manifest__.py +++ b/ext/custom-addons/dp_custom/__manifest__.py @@ -42,6 +42,7 @@ ], 'data': [ 'views/commission_account.xml', + 'wizards/wizard_confirm_null_invoice.xml', 'wizards/wizard_confirm_production.xml', 'wizards/wizard_import_tzbox.xml', 'wizards/wizard_reset_order.xml', diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 5167c948..34cba1b3 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -80,6 +80,17 @@ class AccountInvoice(models.Model): num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items') weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total') + @api.multi + def action_invoice_open(self): + to_open_invoices = self.filtered(lambda inv: inv.state != 'open') + if to_open_invoices.filtered(lambda inv: inv.amount_total != 0) or self.env.context.get('confirmed', False): + res = super(AccountInvoice, self).action_invoice_open() + return res + + action = self.env.ref('dp_custom.action_wizard_confirm_null_invoice').read()[0] + action['context'] = str({"invoice_ids": self.env.context.get("active_ids")}) + return action + @api.multi def _compute_weight_total(self): for record in self: diff --git a/ext/custom-addons/dp_custom/views/account_views.xml b/ext/custom-addons/dp_custom/views/account_views.xml index 9eefaea5..5922385d 100644 --- a/ext/custom-addons/dp_custom/views/account_views.xml +++ b/ext/custom-addons/dp_custom/views/account_views.xml @@ -6,6 +6,14 @@ account.invoice + diff --git a/ext/custom-addons/dp_custom/wizards/__init__.py b/ext/custom-addons/dp_custom/wizards/__init__.py index 158afb89..2f3cbf49 100644 --- a/ext/custom-addons/dp_custom/wizards/__init__.py +++ b/ext/custom-addons/dp_custom/wizards/__init__.py @@ -1,5 +1,6 @@ from . import wizard_confirm_production from . import wizard_import_tzbox +from . import wizard_confirm_null_invoice from . import wizard_confirm_print_invoice from . import portal_assign_company from . import wizard_reset_order diff --git a/ext/custom-addons/dp_reports/reports/report_templates.xml b/ext/custom-addons/dp_reports/reports/report_templates.xml index 58eb69b1..f0a53d9b 100644 --- a/ext/custom-addons/dp_reports/reports/report_templates.xml +++ b/ext/custom-addons/dp_reports/reports/report_templates.xml @@ -102,12 +102,12 @@ IBAN: - + · BIC: - + · - +