From c20ca141226ff5b539e5c28c40e6e16d2bf90343 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Fri, 9 Nov 2018 12:53:44 +0100 Subject: [PATCH] validity_date for offer --- ext/custom-addons/dp_custom/models/product.py | 7 ++++ .../dp_custom/views/account_views.xml | 2 +- .../dp_custom/views/sale_views.xml | 6 ++-- .../dp_custom/views/stock_views.xml | 2 +- .../dp_reports_sale/reports/sale.xml | 33 ++++++++++++++----- .../reports/report_production.xml | 6 ++-- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index 1f8f4e1b..05ea6a23 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -59,6 +59,13 @@ class ProductTemplate(models.Model): manufacturing_number = fields.Char(string='Herstellnummer') product_color = fields.Char(string='Farbe') + @api.onchange('length', 'width', 'thickness') + def _onchange_measures(self): + if self.length>0 and self.width>0 and self.thickness>0: + self.volume = self.length*self.width*self.thickness/(1000*1000*1000) + elif self.length>0 and self.width>0 and self.height>0: + self.volume = self.length*self.width*self.height/(1000*1000*1000) + @api.model def create_product(self, vals): """ diff --git a/ext/custom-addons/dp_custom/views/account_views.xml b/ext/custom-addons/dp_custom/views/account_views.xml index d1138cec..9eefaea5 100644 --- a/ext/custom-addons/dp_custom/views/account_views.xml +++ b/ext/custom-addons/dp_custom/views/account_views.xml @@ -7,7 +7,7 @@ - + diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index f1915e35..f3a6c259 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -51,9 +51,11 @@ + +