From 0abebf9b93b30fcd8e1cca6c147dc5036da51ae5 Mon Sep 17 00:00:00 2001 From: ivan deng Date: Tue, 13 Aug 2019 02:53:49 +0800 Subject: [PATCH] update hat report --- app_product_weight_sale/__manifest__.py | 2 ++ app_product_weight_sale/models/__init__.py | 1 + .../models/res_config_settings.py | 10 ++++++++ .../report/report_sale_order_views.xml | 12 +++++----- .../security/res_group.xml | 17 +++++++++++++ .../views/sale_config_settings_views.xml | 24 +++++++++++++++++++ 6 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 app_product_weight_sale/models/res_config_settings.py create mode 100644 app_product_weight_sale/security/res_group.xml create mode 100644 app_product_weight_sale/views/sale_config_settings_views.xml diff --git a/app_product_weight_sale/__manifest__.py b/app_product_weight_sale/__manifest__.py index 5ad48ea6..0982ff0e 100644 --- a/app_product_weight_sale/__manifest__.py +++ b/app_product_weight_sale/__manifest__.py @@ -20,6 +20,8 @@ 'price': 68, 'depends': ['sale_management'], 'data': [ + 'security/res_group.xml', + 'views/sale_config_settings_views.xml', 'views/sale_order_views.xml', 'report/report_sale_order_views.xml', ], diff --git a/app_product_weight_sale/models/__init__.py b/app_product_weight_sale/models/__init__.py index a7f93b67..948cbc1b 100644 --- a/app_product_weight_sale/models/__init__.py +++ b/app_product_weight_sale/models/__init__.py @@ -2,5 +2,6 @@ from . import sale_order from . import sale_order_line +from . import res_config_settings diff --git a/app_product_weight_sale/models/res_config_settings.py b/app_product_weight_sale/models/res_config_settings.py new file mode 100644 index 00000000..4824f3b7 --- /dev/null +++ b/app_product_weight_sale/models/res_config_settings.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + group_sale_weight_print = fields.Boolean("Show Weight in Sale Print", implied_group='app_product_weight_sale.group_sale_weight_print') diff --git a/app_product_weight_sale/report/report_sale_order_views.xml b/app_product_weight_sale/report/report_sale_order_views.xml index a6c7d38a..4ec9a293 100644 --- a/app_product_weight_sale/report/report_sale_order_views.xml +++ b/app_product_weight_sale/report/report_sale_order_views.xml @@ -8,15 +8,15 @@ - Weight Unit - Weight Subtotal + Weight Unit + Weight Subtotal - - + + - -

+ +

Total Weight:

diff --git a/app_product_weight_sale/security/res_group.xml b/app_product_weight_sale/security/res_group.xml new file mode 100644 index 00000000..732dafed --- /dev/null +++ b/app_product_weight_sale/security/res_group.xml @@ -0,0 +1,17 @@ + + + + + + Show Weight in Sale Print + + + + + + + + \ No newline at end of file diff --git a/app_product_weight_sale/views/sale_config_settings_views.xml b/app_product_weight_sale/views/sale_config_settings_views.xml new file mode 100644 index 00000000..d2d9aaf3 --- /dev/null +++ b/app_product_weight_sale/views/sale_config_settings_views.xml @@ -0,0 +1,24 @@ + + + + app.res.config.settings.view.form.inherit.sale + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+ +