From 92742dfc9d2bdcfe0477c2dbd79781521b03d733 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 1 Feb 2021 19:55:43 +0100 Subject: [PATCH 1/6] product_usability: Improve tree view of supplierinfo --- product_usability/views/product_supplierinfo_view.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/product_usability/views/product_supplierinfo_view.xml b/product_usability/views/product_supplierinfo_view.xml index 1b104c0..6b75ced 100644 --- a/product_usability/views/product_supplierinfo_view.xml +++ b/product_usability/views/product_supplierinfo_view.xml @@ -17,4 +17,15 @@ + + product.supplierinfo + + + + show + + + + + From 183bba3752c9928c87467650b1d5f1a1c8b76243 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Feb 2021 09:59:26 +0100 Subject: [PATCH 2/6] product_usability: make seller_id a stored field, for those who want to display in tree view Add tracking on some fields --- product_usability/models/product_template.py | 33 +++++++------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/product_usability/models/product_template.py b/product_usability/models/product_template.py index 3b0c9b1..01d3458 100644 --- a/product_usability/models/product_template.py +++ b/product_usability/models/product_template.py @@ -14,25 +14,16 @@ class ProductTemplate(models.Model): # in v10, that field was defined in procurement_suggest, but we will # probably not port procurement_suggest because it is native in v14 seller_id = fields.Many2one( - 'res.partner', related='seller_ids.name', string='Main Supplier') + 'res.partner', related='seller_ids.name', store=True, + string='Main Supplier') -# name = fields.Char( -# track_visibility='onchange') - -# type = fields.Selection( -# track_visibility='onchange') - -# categ_id = fields.Many2one( -# track_visibility='onchange') - -# list_price = fields.Float( -# track_visibility='onchange') - -# sale_ok = fields.Boolean( -# track_visibility='onchange') - -# purchase_ok = fields.Boolean( -# track_visibility='onchange') - -# active = fields.Boolean( -# track_visibility='onchange') + # in v14, I noticed that the tracking of the fields of product.template + # are only shown in the form view of product.template, not in the form + # view of product.product + name = fields.Char(tracking=10) + categ_id = fields.Many2one(tracking=20) + type = fields.Selection(tracking=30) + list_price = fields.Float(tracking=40) + sale_ok = fields.Boolean(tracking=50) + purchase_ok = fields.Boolean(tracking=60) + active = fields.Boolean(tracking=70) From b2ce8f0aca8cfc91358196d1f06b7ae5db263065 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Feb 2021 18:33:03 +0100 Subject: [PATCH 3/6] MIG *_product_tree_default to v14 Add module pos_product_tree_default Improve orderpoint views --- pos_product_tree_default/__init__.py | 0 pos_product_tree_default/__manifest__.py | 22 ++++++++++ .../views/product_template.xml | 9 ++++ purchase_product_tree_default/__manifest__.py | 4 +- sale_product_tree_default/__manifest__.py | 4 +- .../views/product_template.xml | 2 +- stock_product_tree_default/__manifest__.py | 6 +-- .../views/product_template.xml | 2 +- stock_usability/__manifest__.py | 1 + .../views/stock_warehouse_orderpoint.xml | 43 +++++++++++++++++++ 10 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 pos_product_tree_default/__init__.py create mode 100644 pos_product_tree_default/__manifest__.py create mode 100644 pos_product_tree_default/views/product_template.xml create mode 100644 stock_usability/views/stock_warehouse_orderpoint.xml diff --git a/pos_product_tree_default/__init__.py b/pos_product_tree_default/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pos_product_tree_default/__manifest__.py b/pos_product_tree_default/__manifest__.py new file mode 100644 index 0000000..800f1fd --- /dev/null +++ b/pos_product_tree_default/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 Akretion (http://www.akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +{ + 'name': 'POS Product Tree Default', + 'version': '14.0.1.0.0', + 'category': 'Product', + 'license': 'AGPL-3', + 'summary': 'Tree view by default instead of kanban for Products', + 'description': """ + Replace default kanban view by tree view for product menu in Point of Sale + main menu + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['point_of_sale'], + 'data': [ + 'views/product_template.xml' + ], + 'installable': True, +} diff --git a/pos_product_tree_default/views/product_template.xml b/pos_product_tree_default/views/product_template.xml new file mode 100644 index 0000000..79122a9 --- /dev/null +++ b/pos_product_tree_default/views/product_template.xml @@ -0,0 +1,9 @@ + + + + + + tree,form,kanban,activity + + + diff --git a/purchase_product_tree_default/__manifest__.py b/purchase_product_tree_default/__manifest__.py index d2bc4bf..49c18c8 100644 --- a/purchase_product_tree_default/__manifest__.py +++ b/purchase_product_tree_default/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Purchase Product Tree Default', - 'version': '12.0.1.0.0', + 'version': '14.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': 'Tree view by default instead of kanban for Products', @@ -18,5 +18,5 @@ 'data': [ 'views/product_template.xml' ], - 'installable': False, + 'installable': True, } diff --git a/sale_product_tree_default/__manifest__.py b/sale_product_tree_default/__manifest__.py index 8ae69c0..4f7b7a5 100644 --- a/sale_product_tree_default/__manifest__.py +++ b/sale_product_tree_default/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Sale Product Tree Default', - 'version': '12.0.1.0.0', + 'version': '14.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': 'Tree view by default instead of kanban for Products', @@ -18,5 +18,5 @@ 'data': [ 'views/product_template.xml' ], - 'installable': False, + 'installable': True, } diff --git a/sale_product_tree_default/views/product_template.xml b/sale_product_tree_default/views/product_template.xml index 04626e1..aeb1e44 100644 --- a/sale_product_tree_default/views/product_template.xml +++ b/sale_product_tree_default/views/product_template.xml @@ -4,7 +4,7 @@ tree,form,kanban,activity - + diff --git a/stock_product_tree_default/__manifest__.py b/stock_product_tree_default/__manifest__.py index a8ed941..f27d7bd 100644 --- a/stock_product_tree_default/__manifest__.py +++ b/stock_product_tree_default/__manifest__.py @@ -1,10 +1,10 @@ -# © 2019 Akretion (http://www.akretion.com) +# Copyright 2019-2021 Akretion (http://www.akretion.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Stock Product Tree Default', - 'version': '12.0.1.0.0', + 'version': '14.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': 'Tree view by default instead of kanban for Products', @@ -18,5 +18,5 @@ 'data': [ 'views/product_template.xml' ], - 'installable': False, + 'installable': True, } diff --git a/stock_product_tree_default/views/product_template.xml b/stock_product_tree_default/views/product_template.xml index 5e87885..d3ca2a9 100644 --- a/stock_product_tree_default/views/product_template.xml +++ b/stock_product_tree_default/views/product_template.xml @@ -4,7 +4,7 @@ tree,form,kanban,activity - + diff --git a/stock_usability/__manifest__.py b/stock_usability/__manifest__.py index 4acb88c..9d95726 100644 --- a/stock_usability/__manifest__.py +++ b/stock_usability/__manifest__.py @@ -32,6 +32,7 @@ This module has been written by Alexis de Lattre from Akretion + + + + + + + stock.warehouse.orderpoint + + + + + + + + + + stock.warehouse.orderpoint + + + + show + + + + + + stock.warehouse.orderpoint + + + + show + + + + + + + From 9c30d4ef53da7a0e6b8a34fdabf6db6d99b49ebd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Feb 2021 18:40:27 +0100 Subject: [PATCH 4/6] stock_usability: responsible_id is now hidden by default in tree view --- stock_usability/__manifest__.py | 1 + stock_usability/views/product.xml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 stock_usability/views/product.xml diff --git a/stock_usability/__manifest__.py b/stock_usability/__manifest__.py index 9d95726..f878039 100644 --- a/stock_usability/__manifest__.py +++ b/stock_usability/__manifest__.py @@ -33,6 +33,7 @@ This module has been written by Alexis de Lattre from Akretion + + + + + + + stock.usability.product.template.tree + product.template + + + + hide + + + + + + From 0d4ff3778636949e680cc7830e3136a96876179d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 3 Feb 2021 11:53:22 +0100 Subject: [PATCH 5/6] pos_usability: add missing check_company=True on pos.payment.method, field cash_journal_id --- pos_usability/models/__init__.py | 1 + pos_usability/models/pos_payment_method.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 pos_usability/models/pos_payment_method.py diff --git a/pos_usability/models/__init__.py b/pos_usability/models/__init__.py index 4d5f90b..ae2a8a4 100644 --- a/pos_usability/models/__init__.py +++ b/pos_usability/models/__init__.py @@ -1,2 +1,3 @@ from . import product from . import pos_category +from . import pos_payment_method diff --git a/pos_usability/models/pos_payment_method.py b/pos_usability/models/pos_payment_method.py new file mode 100644 index 0000000..4707db3 --- /dev/null +++ b/pos_usability/models/pos_payment_method.py @@ -0,0 +1,12 @@ +# Copyright 2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class PosPaymentMethod(models.Model): + _inherit = 'pos.payment.method' + _check_company_auto = True + + cash_journal_id = fields.Many2one(check_company=True) From 45d734badfd97782270d63c81db0149fe26e2466 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 3 Feb 2021 18:05:03 +0100 Subject: [PATCH 6/6] Fix access rights in product_print_zpl_barcode In odoo v14, read of ir.actions.act_windows is restricted to base.group_system --- product_print_zpl_barcode/models/product.py | 2 +- product_print_zpl_barcode/wizard/product_print_zpl_barcode.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/product_print_zpl_barcode/models/product.py b/product_print_zpl_barcode/models/product.py index 908d84e..6853de6 100644 --- a/product_print_zpl_barcode/models/product.py +++ b/product_print_zpl_barcode/models/product.py @@ -35,7 +35,7 @@ class ProductTemplate(models.Model): "because it has %d variants and not just one.") % (self.display_name, self.product_variant_count)) action = self.env.ref( - 'product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + 'product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action['context'] = { 'active_id': self.product_variant_ids[0].id, 'active_model': 'product.product', diff --git a/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py b/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py index 26be01a..45a05b1 100644 --- a/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py +++ b/product_print_zpl_barcode/wizard/product_print_zpl_barcode.py @@ -270,7 +270,7 @@ class ProductPrintZplBarcode(models.TransientModel): 'zpl_filename': 'barcode_%s.zpl' % vals['barcode'], }) self.write(vals) - action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action.update({ 'res_id': self.id, 'context': self._context, @@ -285,7 +285,7 @@ class ProductPrintZplBarcode(models.TransientModel): self.zpl_filename, base64.decodebytes(self.zpl_file), format='raw') action = True if self._context.get('print_and_new'): - action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').read()[0] + action = self.env.ref('product_print_zpl_barcode.product_print_zpl_barcode_action').sudo().read()[0] action.update({ 'views': False, 'context': self._context,