From 2246c6caa9bf5333abe72f1d71cc1099af222a72 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Wed, 8 Apr 2020 15:21:04 +0200 Subject: [PATCH] new: 'Indiviual Discount`' insted of 'Dealer Discount'; Additional Filter for Invoices 'Referenzbeleg' --- ext/custom-addons/dp_custom/models/account.py | 2 ++ .../dp_custom/views/account_views.xml | 15 ++++++++++ .../tz_dealer_discount/models/invoice.py | 23 +++++++++++---- .../tz_dealer_discount/models/sale.py | 28 ++++++++++++++----- .../tz_dealer_discount/views/invoice_view.xml | 15 ++++++++-- .../tz_dealer_discount/views/sale_view.xml | 14 +++++++--- 6 files changed, 77 insertions(+), 20 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 34cba1b3..281902a9 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -80,6 +80,8 @@ 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') + layout_category_id = fields.Many2one('sale.layout_category', related='invoice_line_ids.layout_category_id', string='Section') + @api.multi def action_invoice_open(self): to_open_invoices = self.filtered(lambda inv: inv.state != 'open') diff --git a/ext/custom-addons/dp_custom/views/account_views.xml b/ext/custom-addons/dp_custom/views/account_views.xml index 087ec6c4..6e45935d 100644 --- a/ext/custom-addons/dp_custom/views/account_views.xml +++ b/ext/custom-addons/dp_custom/views/account_views.xml @@ -14,6 +14,7 @@