From e5f629035da0313398a2ef5b35fae84a6557299f Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 11 Feb 2015 18:46:47 +0100 Subject: [PATCH 01/36] new module purchase_all_shipments --- purchase_all_shipments/README.rst | 7 +++ purchase_all_shipments/__init__.py | 1 + purchase_all_shipments/__openerp__.py | 23 +++++++ purchase_all_shipments/model/__init__.py | 1 + .../model/purchase_order.py | 61 +++++++++++++++++++ .../view/purchase_order.xml | 25 ++++++++ 6 files changed, 118 insertions(+) create mode 100644 purchase_all_shipments/README.rst create mode 100644 purchase_all_shipments/__init__.py create mode 100644 purchase_all_shipments/__openerp__.py create mode 100644 purchase_all_shipments/model/__init__.py create mode 100644 purchase_all_shipments/model/purchase_order.py create mode 100644 purchase_all_shipments/view/purchase_order.xml diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst new file mode 100644 index 00000000000..4c20919c448 --- /dev/null +++ b/purchase_all_shipments/README.rst @@ -0,0 +1,7 @@ +Purchase All Shipments +====================== + +Contributors +------------ + +* Leonardo Pistone diff --git a/purchase_all_shipments/__init__.py b/purchase_all_shipments/__init__.py new file mode 100644 index 00000000000..9186ee3ad24 --- /dev/null +++ b/purchase_all_shipments/__init__.py @@ -0,0 +1 @@ +from . import model diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__openerp__.py new file mode 100644 index 00000000000..63420651784 --- /dev/null +++ b/purchase_all_shipments/__openerp__.py @@ -0,0 +1,23 @@ +# Author: Leonardo Pistone +# Copyright 2015 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +{'name': 'Purchase All Shipments', + 'version': '1.0', + 'author': 'Camptocamp', + 'category': 'Purchases', + 'license': 'AGPL-3', + 'depends': ['purchase'], + 'data': ['view/purchase_order.xml'], + } diff --git a/purchase_all_shipments/model/__init__.py b/purchase_all_shipments/model/__init__.py new file mode 100644 index 00000000000..9f03530643d --- /dev/null +++ b/purchase_all_shipments/model/__init__.py @@ -0,0 +1 @@ +from . import purchase_order diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py new file mode 100644 index 00000000000..ca866c7c165 --- /dev/null +++ b/purchase_all_shipments/model/purchase_order.py @@ -0,0 +1,61 @@ +# Author: Leonardo Pistone +# Copyright 2015 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +from openerp import models, fields, api + + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + def _all_shipment_count(self): + self.all_shipment_count = len(self.all_picking_ids) + + def _all_pickings(self): + groups = self.env['procurement.group'] + for pick in self.picking_ids: + for move in pick.move_lines: + groups |= move.group_id + + all_moves = self.env['stock.move'].search( + [('group_id', 'in', groups.mapped('id'))] + ) + self.all_picking_ids = all_moves.mapped('picking_id') + + @api.multi + def view_all_picking(self): + """Similar to the view_picking method in the purchase module""" + action_data = self.env.ref('stock.action_picking_tree').read()[0] + pickings = self.env['stock.picking'] + for po in self: + pickings |= po.all_picking_ids + + # override the context to get rid of the default filtering on + # picking type + action_data['context'] = {} + + # choose the view_mode accordingly + if len(pickings) > 1: + action_data['domain'] = [('id', 'in', pickings.mapped('id'))] + else: + form_view = self.env.ref('stock.view_picking_form') + action_data['views'] = [(form_view.id, 'form')] + action_data['res_id'] = pickings.id + return action_data + + all_picking_ids = fields.One2many('stock.picking', + string='All Shipments', + compute=_all_pickings) + all_shipment_count = fields.Integer('All Shipments', + compute=_all_shipment_count) diff --git a/purchase_all_shipments/view/purchase_order.xml b/purchase_all_shipments/view/purchase_order.xml new file mode 100644 index 00000000000..34bbcf61743 --- /dev/null +++ b/purchase_all_shipments/view/purchase_order.xml @@ -0,0 +1,25 @@ + + + + + + purchase_order_form + purchase.order + + + + + + + + + + + From 02c7f2a6e8408eb7cb18dfd1efd7ad69f76f4ebc Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 12 Feb 2015 12:23:09 +0100 Subject: [PATCH 02/36] fix view, and replace existing button --- purchase_all_shipments/view/purchase_order.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/purchase_all_shipments/view/purchase_order.xml b/purchase_all_shipments/view/purchase_order.xml index 34bbcf61743..513b801dddc 100644 --- a/purchase_all_shipments/view/purchase_order.xml +++ b/purchase_all_shipments/view/purchase_order.xml @@ -8,7 +8,7 @@ - + + + 1 + + From 982714aaed532bdab6d927be234aae93de0e4608 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 12 Feb 2015 12:32:58 +0100 Subject: [PATCH 03/36] doc --- purchase_all_shipments/README.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index 4c20919c448..d44ef609440 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -1,7 +1,36 @@ Purchase All Shipments ====================== +With the core "purchase" module, in a purchase order a button "In Shipments" +lets the user see the picking that was generated by the order itself. + +With this module, that button is replaced by an "All Shipments" button that +shows the original picking, and all others that are grouped with it. This +should include pickings associated to the procurements that generated the +purchase, and also pickings that have been chained with push rules. + +This in consistent with the "sale" module, where from the sale order the user can access the generated delivery and all chained ones. + +The implementation uses the procurement group of the moves in the generated +picking. The procurement group is always present in purchases, also when there +is no procurement. + Contributors ------------ * Leonardo Pistone + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. From 5d9b866b81da10f8bc3474edecf021199f226a48 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 13 Feb 2015 15:55:51 +0100 Subject: [PATCH 04/36] pass compute methods as strings This allows them to be inherited easily. --- purchase_all_shipments/model/purchase_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py index ca866c7c165..a00eda898b3 100644 --- a/purchase_all_shipments/model/purchase_order.py +++ b/purchase_all_shipments/model/purchase_order.py @@ -56,6 +56,6 @@ def view_all_picking(self): all_picking_ids = fields.One2many('stock.picking', string='All Shipments', - compute=_all_pickings) + compute='_all_pickings') all_shipment_count = fields.Integer('All Shipments', - compute=_all_shipment_count) + compute='_all_shipment_count') From 8f597f827cdf3c70fcfd03cef5c18f8b8bd197b8 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 13 Feb 2015 16:34:19 +0100 Subject: [PATCH 05/36] add a test: 3-step reception gives 3 pickings --- purchase_all_shipments/tests/__init__.py | 1 + .../tests/test_three_step_reception.py | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 purchase_all_shipments/tests/__init__.py create mode 100644 purchase_all_shipments/tests/test_three_step_reception.py diff --git a/purchase_all_shipments/tests/__init__.py b/purchase_all_shipments/tests/__init__.py new file mode 100644 index 00000000000..19f196fac18 --- /dev/null +++ b/purchase_all_shipments/tests/__init__.py @@ -0,0 +1 @@ +from . import test_three_step_reception diff --git a/purchase_all_shipments/tests/test_three_step_reception.py b/purchase_all_shipments/tests/test_three_step_reception.py new file mode 100644 index 00000000000..7167954cccd --- /dev/null +++ b/purchase_all_shipments/tests/test_three_step_reception.py @@ -0,0 +1,29 @@ +# Author: Leonardo Pistone +# Copyright 2015 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +from openerp.tests import common + + +class TestThreeStepReception(common.TransactionCase): + + def test_three_steps_generate_three_pickings(self): + wh = self.env.ref('stock.warehouse0') + wh.reception_steps = 'three_steps' + po = self.env.ref('purchase.purchase_order_1') + po.location_id = wh.wh_input_stock_loc_id + po.signal_workflow('purchase_confirm') + + self.assertEqual(1, po.shipment_count) + self.assertEqual(3, po.all_shipment_count) From 0fca998bbdd832fcbab6b9e4b055c22764ada3d4 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 18 Feb 2015 17:35:13 +0100 Subject: [PATCH 06/36] fix typo in readme --- purchase_all_shipments/README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index d44ef609440..df3398ba18a 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -9,7 +9,8 @@ shows the original picking, and all others that are grouped with it. This should include pickings associated to the procurements that generated the purchase, and also pickings that have been chained with push rules. -This in consistent with the "sale" module, where from the sale order the user can access the generated delivery and all chained ones. +This is consistent with the "sale" module, where from the sale order the user +can access the generated delivery and all chained ones. The implementation uses the procurement group of the moves in the generated picking. The procurement group is always present in purchases, also when there From fd5526e6a10188a7212283679c44385d94db9dfd Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 18 Feb 2015 17:39:49 +0100 Subject: [PATCH 07/36] refactor: mapped joins recordsets --- purchase_all_shipments/model/purchase_order.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py index a00eda898b3..e16756850cb 100644 --- a/purchase_all_shipments/model/purchase_order.py +++ b/purchase_all_shipments/model/purchase_order.py @@ -37,9 +37,7 @@ def _all_pickings(self): def view_all_picking(self): """Similar to the view_picking method in the purchase module""" action_data = self.env.ref('stock.action_picking_tree').read()[0] - pickings = self.env['stock.picking'] - for po in self: - pickings |= po.all_picking_ids + pickings = self.mapped('all_picking_ids') # override the context to get rid of the default filtering on # picking type From 3d4229f20098f7ba73cac3180a24aba9ff1b66f1 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 18 Feb 2015 17:43:36 +0100 Subject: [PATCH 08/36] another clever use of mapped() --- purchase_all_shipments/model/purchase_order.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py index e16756850cb..e50723f1d47 100644 --- a/purchase_all_shipments/model/purchase_order.py +++ b/purchase_all_shipments/model/purchase_order.py @@ -23,10 +23,7 @@ def _all_shipment_count(self): self.all_shipment_count = len(self.all_picking_ids) def _all_pickings(self): - groups = self.env['procurement.group'] - for pick in self.picking_ids: - for move in pick.move_lines: - groups |= move.group_id + groups = self.mapped('picking_ids.move_lines.group_id') all_moves = self.env['stock.move'].search( [('group_id', 'in', groups.mapped('id'))] From 0616b80e74c0cab64a785e4352ce16673ce65d9f Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Thu, 19 Feb 2015 10:37:28 +0100 Subject: [PATCH 09/36] refactor .mapped('id') -> .ids --- purchase_all_shipments/model/purchase_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py index e50723f1d47..8002e1a7eda 100644 --- a/purchase_all_shipments/model/purchase_order.py +++ b/purchase_all_shipments/model/purchase_order.py @@ -26,7 +26,7 @@ def _all_pickings(self): groups = self.mapped('picking_ids.move_lines.group_id') all_moves = self.env['stock.move'].search( - [('group_id', 'in', groups.mapped('id'))] + [('group_id', 'in', groups.ids)] ) self.all_picking_ids = all_moves.mapped('picking_id') @@ -42,7 +42,7 @@ def view_all_picking(self): # choose the view_mode accordingly if len(pickings) > 1: - action_data['domain'] = [('id', 'in', pickings.mapped('id'))] + action_data['domain'] = [('id', 'in', pickings.ids)] else: form_view = self.env.ref('stock.view_picking_form') action_data['views'] = [(form_view.id, 'form')] From 69d67aaddb888536cf8e63eef19d1c535d0faaa9 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:27:20 +0100 Subject: [PATCH 10/36] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- purchase_all_shipments/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__openerp__.py index 63420651784..91ea3e7f09c 100644 --- a/purchase_all_shipments/__openerp__.py +++ b/purchase_all_shipments/__openerp__.py @@ -15,7 +15,7 @@ # along with this program. If not, see . {'name': 'Purchase All Shipments', 'version': '1.0', - 'author': 'Camptocamp', + 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Purchases', 'license': 'AGPL-3', 'depends': ['purchase'], From f602ed785707edd008c44bc160b802c82886542e Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 18 Aug 2015 11:22:31 +0200 Subject: [PATCH 11/36] Add missing default oca icons --- .../static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 purchase_all_shipments/static/description/icon.png diff --git a/purchase_all_shipments/static/description/icon.png b/purchase_all_shipments/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e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H 12/36] [UPD] prefix versions with 8.0 --- purchase_all_shipments/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__openerp__.py index 91ea3e7f09c..d34ed33a290 100644 --- a/purchase_all_shipments/__openerp__.py +++ b/purchase_all_shipments/__openerp__.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . {'name': 'Purchase All Shipments', - 'version': '1.0', + 'version': '8.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Purchases', 'license': 'AGPL-3', From 425b92ac93038d379f34ac825018a136c963a53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Sun, 13 Dec 2015 16:13:54 +0100 Subject: [PATCH 13/36] Fix 9.0 version --- purchase_all_shipments/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__openerp__.py index d34ed33a290..c50af33a729 100644 --- a/purchase_all_shipments/__openerp__.py +++ b/purchase_all_shipments/__openerp__.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . {'name': 'Purchase All Shipments', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Purchases', 'license': 'AGPL-3', From 6adc01b2b4a8edd74c0c1bd64e222fdba0c628e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 14 Dec 2015 10:03:13 +0100 Subject: [PATCH 14/36] purchase_all_shipment is unported --- purchase_all_shipments/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__openerp__.py index c50af33a729..42b126be09f 100644 --- a/purchase_all_shipments/__openerp__.py +++ b/purchase_all_shipments/__openerp__.py @@ -14,10 +14,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . {'name': 'Purchase All Shipments', - 'version': '9.0.1.0.0', + 'version': '8.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Purchases', 'license': 'AGPL-3', 'depends': ['purchase'], 'data': ['view/purchase_order.xml'], + 'installable': False, } From 4e3404aade319de78e853c35b4cf96dc6692275c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 16:06:28 +0200 Subject: [PATCH 15/36] [MIG] Rename manifest files --- purchase_all_shipments/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename purchase_all_shipments/{__openerp__.py => __manifest__.py} (100%) diff --git a/purchase_all_shipments/__openerp__.py b/purchase_all_shipments/__manifest__.py similarity index 100% rename from purchase_all_shipments/__openerp__.py rename to purchase_all_shipments/__manifest__.py From 4a1eeb02d485fdc3f5add63b810b8d65560656fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Mac=20Rouillon?= Date: Tue, 25 Aug 2020 15:24:10 -0300 Subject: [PATCH 16/36] [IMP] purchase_all_shipments : black, isort, prettier --- purchase_all_shipments/__manifest__.py | 19 +++--- .../model/purchase_order.py | 35 +++++------ .../tests/test_three_step_reception.py | 9 ++- .../view/purchase_order.xml | 61 ++++++++++--------- 4 files changed, 63 insertions(+), 61 deletions(-) diff --git a/purchase_all_shipments/__manifest__.py b/purchase_all_shipments/__manifest__.py index 42b126be09f..96a9797cf6a 100644 --- a/purchase_all_shipments/__manifest__.py +++ b/purchase_all_shipments/__manifest__.py @@ -13,12 +13,13 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -{'name': 'Purchase All Shipments', - 'version': '8.0.1.0.0', - 'author': "Camptocamp,Odoo Community Association (OCA)", - 'category': 'Purchases', - 'license': 'AGPL-3', - 'depends': ['purchase'], - 'data': ['view/purchase_order.xml'], - 'installable': False, - } +{ + "name": "Purchase All Shipments", + "version": "8.0.1.0.0", + "author": "Camptocamp,Odoo Community Association (OCA)", + "category": "Purchases", + "license": "AGPL-3", + "depends": ["purchase"], + "data": ["view/purchase_order.xml"], + "installable": False, +} diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py index 8002e1a7eda..8d07286270b 100644 --- a/purchase_all_shipments/model/purchase_order.py +++ b/purchase_all_shipments/model/purchase_order.py @@ -13,44 +13,41 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from openerp import models, fields, api +from openerp import api, fields, models class PurchaseOrder(models.Model): - _inherit = 'purchase.order' + _inherit = "purchase.order" def _all_shipment_count(self): self.all_shipment_count = len(self.all_picking_ids) def _all_pickings(self): - groups = self.mapped('picking_ids.move_lines.group_id') + groups = self.mapped("picking_ids.move_lines.group_id") - all_moves = self.env['stock.move'].search( - [('group_id', 'in', groups.ids)] - ) - self.all_picking_ids = all_moves.mapped('picking_id') + all_moves = self.env["stock.move"].search([("group_id", "in", groups.ids)]) + self.all_picking_ids = all_moves.mapped("picking_id") @api.multi def view_all_picking(self): """Similar to the view_picking method in the purchase module""" - action_data = self.env.ref('stock.action_picking_tree').read()[0] - pickings = self.mapped('all_picking_ids') + action_data = self.env.ref("stock.action_picking_tree").read()[0] + pickings = self.mapped("all_picking_ids") # override the context to get rid of the default filtering on # picking type - action_data['context'] = {} + action_data["context"] = {} # choose the view_mode accordingly if len(pickings) > 1: - action_data['domain'] = [('id', 'in', pickings.ids)] + action_data["domain"] = [("id", "in", pickings.ids)] else: - form_view = self.env.ref('stock.view_picking_form') - action_data['views'] = [(form_view.id, 'form')] - action_data['res_id'] = pickings.id + form_view = self.env.ref("stock.view_picking_form") + action_data["views"] = [(form_view.id, "form")] + action_data["res_id"] = pickings.id return action_data - all_picking_ids = fields.One2many('stock.picking', - string='All Shipments', - compute='_all_pickings') - all_shipment_count = fields.Integer('All Shipments', - compute='_all_shipment_count') + all_picking_ids = fields.One2many( + "stock.picking", string="All Shipments", compute="_all_pickings" + ) + all_shipment_count = fields.Integer("All Shipments", compute="_all_shipment_count") diff --git a/purchase_all_shipments/tests/test_three_step_reception.py b/purchase_all_shipments/tests/test_three_step_reception.py index 7167954cccd..86ccd78df4e 100644 --- a/purchase_all_shipments/tests/test_three_step_reception.py +++ b/purchase_all_shipments/tests/test_three_step_reception.py @@ -17,13 +17,12 @@ class TestThreeStepReception(common.TransactionCase): - def test_three_steps_generate_three_pickings(self): - wh = self.env.ref('stock.warehouse0') - wh.reception_steps = 'three_steps' - po = self.env.ref('purchase.purchase_order_1') + wh = self.env.ref("stock.warehouse0") + wh.reception_steps = "three_steps" + po = self.env.ref("purchase.purchase_order_1") po.location_id = wh.wh_input_stock_loc_id - po.signal_workflow('purchase_confirm') + po.signal_workflow("purchase_confirm") self.assertEqual(1, po.shipment_count) self.assertEqual(3, po.all_shipment_count) diff --git a/purchase_all_shipments/view/purchase_order.xml b/purchase_all_shipments/view/purchase_order.xml index 513b801dddc..ca7b784f03c 100644 --- a/purchase_all_shipments/view/purchase_order.xml +++ b/purchase_all_shipments/view/purchase_order.xml @@ -1,30 +1,35 @@ - + - - - - purchase_order_form - purchase.order - - - - - - - - - 1 - - - - - - + + + purchase_order_form + purchase.order + + + + + + + 1 + + + + From 57ef13fb1b201d2cc52b9888e3c9cc083b74a3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Mac=20Rouillon?= Date: Tue, 25 Aug 2020 16:22:23 -0300 Subject: [PATCH 17/36] [MIG] purchase_all_shipments: migrate to v13 --- purchase_all_shipments/README.rst | 51 ++++++++++++++--- purchase_all_shipments/__init__.py | 2 +- purchase_all_shipments/__manifest__.py | 25 ++------- purchase_all_shipments/i18n/es.po | 37 +++++++++++++ .../i18n/purchase_all_shipments.pot | 37 +++++++++++++ .../model/purchase_order.py | 53 ------------------ .../{model => models}/__init__.py | 0 .../models/purchase_order.py | 44 +++++++++++++++ .../readme/CONTRIBUTORS.rst | 2 + purchase_all_shipments/readme/DESCRIPTION.rst | 7 +++ .../tests/test_three_step_reception.py | 55 +++++++++++-------- .../view/purchase_order.xml | 35 ------------ .../views/purchase_order_views.xml | 36 ++++++++++++ 13 files changed, 244 insertions(+), 140 deletions(-) create mode 100644 purchase_all_shipments/i18n/es.po create mode 100644 purchase_all_shipments/i18n/purchase_all_shipments.pot delete mode 100644 purchase_all_shipments/model/purchase_order.py rename purchase_all_shipments/{model => models}/__init__.py (100%) create mode 100644 purchase_all_shipments/models/purchase_order.py create mode 100644 purchase_all_shipments/readme/CONTRIBUTORS.rst create mode 100644 purchase_all_shipments/readme/DESCRIPTION.rst delete mode 100644 purchase_all_shipments/view/purchase_order.xml create mode 100644 purchase_all_shipments/views/purchase_order_views.xml diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index df3398ba18a..f149907dddc 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -1,6 +1,30 @@ +====================== Purchase All Shipments ====================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-workflow/tree/13.0/purchase_all_shipments + :alt: OCA/purchase-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_all_shipments + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/142/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + With the core "purchase" module, in a purchase order a button "In Shipments" lets the user see the picking that was generated by the order itself. @@ -16,22 +40,33 @@ The implementation uses the procurement group of the moves in the generated picking. The procurement group is always present in purchases, also when there is no procurement. + +**Table of contents** + +.. contents:: + :local: + + Contributors ------------- +~~~~~~~~~~~~ * Leonardo Pistone +* Nicolas Mac Rouillon -Maintainer ----------- - -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org +Maintainers +~~~~~~~~~~~ This module is maintained by the OCA. +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +This module is part of the `OCA/purchase-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. + diff --git a/purchase_all_shipments/__init__.py b/purchase_all_shipments/__init__.py index 9186ee3ad24..0650744f6bc 100644 --- a/purchase_all_shipments/__init__.py +++ b/purchase_all_shipments/__init__.py @@ -1 +1 @@ -from . import model +from . import models diff --git a/purchase_all_shipments/__manifest__.py b/purchase_all_shipments/__manifest__.py index 96a9797cf6a..a8886efc1d5 100644 --- a/purchase_all_shipments/__manifest__.py +++ b/purchase_all_shipments/__manifest__.py @@ -1,25 +1,12 @@ -# Author: Leonardo Pistone -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# Copyright 2018 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { "name": "Purchase All Shipments", - "version": "8.0.1.0.0", + "version": "13.0.1.0.0", "author": "Camptocamp,Odoo Community Association (OCA)", "category": "Purchases", "license": "AGPL-3", - "depends": ["purchase"], - "data": ["view/purchase_order.xml"], - "installable": False, + "depends": ["purchase_stock"], + "installable": True, + "data": ["views/purchase_order_views.xml"], } diff --git a/purchase_all_shipments/i18n/es.po b/purchase_all_shipments/i18n/es.po new file mode 100644 index 00000000000..6560db09c42 --- /dev/null +++ b/purchase_all_shipments/i18n/es.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_all_shipments +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-25 19:03+0000\n" +"PO-Revision-Date: 2020-08-25 19:03+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: purchase_all_shipments +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_ids +#: model_terms:ir.ui.view,arch_db:purchase_all_shipments.purchase_order_view_form_inherit +msgid "All Pickings" +msgstr "En recepciones" + +#. module: purchase_all_shipments +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_shipment_count +msgid "All Pickings Count" +msgstr "" + +#. module: purchase_all_shipments +#: model_terms:ir.ui.view,arch_db:purchase_all_shipments.purchase_order_view_form_inherit +msgid "All Pickings, including chained" +msgstr "Todas las recepciones, incluidos encadenados" + +#. module: purchase_all_shipments +#: model:ir.model,name:purchase_all_shipments.model_purchase_order +msgid "Purchase Order" +msgstr "Línea orden de compra" diff --git a/purchase_all_shipments/i18n/purchase_all_shipments.pot b/purchase_all_shipments/i18n/purchase_all_shipments.pot new file mode 100644 index 00000000000..aacea707482 --- /dev/null +++ b/purchase_all_shipments/i18n/purchase_all_shipments.pot @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_all_shipments +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-25 19:02+0000\n" +"PO-Revision-Date: 2020-08-25 19:02+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: purchase_all_shipments +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_ids +#: model_terms:ir.ui.view,arch_db:purchase_all_shipments.purchase_order_view_form_inherit +msgid "All Pickings" +msgstr "" + +#. module: purchase_all_shipments +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_shipment_count +msgid "All Pickings Count" +msgstr "" + +#. module: purchase_all_shipments +#: model_terms:ir.ui.view,arch_db:purchase_all_shipments.purchase_order_view_form_inherit +msgid "All Pickings, including chained" +msgstr "" + +#. module: purchase_all_shipments +#: model:ir.model,name:purchase_all_shipments.model_purchase_order +msgid "Purchase Order" +msgstr "" diff --git a/purchase_all_shipments/model/purchase_order.py b/purchase_all_shipments/model/purchase_order.py deleted file mode 100644 index 8d07286270b..00000000000 --- a/purchase_all_shipments/model/purchase_order.py +++ /dev/null @@ -1,53 +0,0 @@ -# Author: Leonardo Pistone -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from openerp import api, fields, models - - -class PurchaseOrder(models.Model): - _inherit = "purchase.order" - - def _all_shipment_count(self): - self.all_shipment_count = len(self.all_picking_ids) - - def _all_pickings(self): - groups = self.mapped("picking_ids.move_lines.group_id") - - all_moves = self.env["stock.move"].search([("group_id", "in", groups.ids)]) - self.all_picking_ids = all_moves.mapped("picking_id") - - @api.multi - def view_all_picking(self): - """Similar to the view_picking method in the purchase module""" - action_data = self.env.ref("stock.action_picking_tree").read()[0] - pickings = self.mapped("all_picking_ids") - - # override the context to get rid of the default filtering on - # picking type - action_data["context"] = {} - - # choose the view_mode accordingly - if len(pickings) > 1: - action_data["domain"] = [("id", "in", pickings.ids)] - else: - form_view = self.env.ref("stock.view_picking_form") - action_data["views"] = [(form_view.id, "form")] - action_data["res_id"] = pickings.id - return action_data - - all_picking_ids = fields.One2many( - "stock.picking", string="All Shipments", compute="_all_pickings" - ) - all_shipment_count = fields.Integer("All Shipments", compute="_all_shipment_count") diff --git a/purchase_all_shipments/model/__init__.py b/purchase_all_shipments/models/__init__.py similarity index 100% rename from purchase_all_shipments/model/__init__.py rename to purchase_all_shipments/models/__init__.py diff --git a/purchase_all_shipments/models/purchase_order.py b/purchase_all_shipments/models/purchase_order.py new file mode 100644 index 00000000000..9f481df2998 --- /dev/null +++ b/purchase_all_shipments/models/purchase_order.py @@ -0,0 +1,44 @@ +# Copyright 2018 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +from odoo import fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + all_picking_ids = fields.One2many( + "stock.picking", string="All Pickings", compute="_compute_all_pickings" + ) + all_picking_count = fields.Integer( + "All Pickings Count", compute="_compute_all_picking_count" + ) + + def _compute_all_picking_count(self): + for rec in self: + rec.all_picking_count = len(rec.all_picking_ids) + + def _compute_all_pickings(self): + for rec in self: + groups = rec.mapped("picking_ids.group_id") + all_picking_ids = self.env["stock.picking"].search( + [("group_id", "in", groups.ids)] + ) + rec.all_picking_ids = all_picking_ids + + def action_view_all_pickings(self): + """Similar to the view_picking method in the purchase module""" + action_data = self.env.ref("stock.action_picking_tree_all").read()[0] + pickings = self.mapped("all_picking_ids") + + # override the context to get rid of the default filtering on + # picking type + action_data["context"] = {} + + # choose the view_mode accordingly + if len(pickings) > 1: + action_data["domain"] = [("id", "in", pickings.ids)] + else: + form_view = self.env.ref("stock.view_picking_form") + action_data["views"] = [(form_view.id, "form")] + action_data["res_id"] = pickings.id + return action_data diff --git a/purchase_all_shipments/readme/CONTRIBUTORS.rst b/purchase_all_shipments/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..c33e43a62b6 --- /dev/null +++ b/purchase_all_shipments/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Leonardo Pistone +* Nicolas Mac Rouillon diff --git a/purchase_all_shipments/readme/DESCRIPTION.rst b/purchase_all_shipments/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..7d08687a660 --- /dev/null +++ b/purchase_all_shipments/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +With the core "purchase" module, in a purchase order a button "In Shipments" lets the user see the picking that was generated by the order itself. + +With this module, that button is replaced by an "All Shipments" button that shows the original picking, and all others that are grouped with it. This should include pickings associated to the procurements that generated the purchase, and also pickings that have been chained with push rules. + +This is consistent with the "sale" module, where from the sale order the user can access the generated delivery and all chained ones. + +The implementation uses the procurement group of the moves in the generated picking. The procurement group is always present in purchases, also when there is no procurement. diff --git a/purchase_all_shipments/tests/test_three_step_reception.py b/purchase_all_shipments/tests/test_three_step_reception.py index 86ccd78df4e..a615ea1d3fb 100644 --- a/purchase_all_shipments/tests/test_three_step_reception.py +++ b/purchase_all_shipments/tests/test_three_step_reception.py @@ -1,28 +1,35 @@ -# Author: Leonardo Pistone -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from openerp.tests import common +# Copyright 2018 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +from odoo.tests.common import SavepointCase + + +class TestThreeStepReception(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.wh = cls.env.ref("stock.warehouse0") + cls.po = cls.env.ref("purchase.purchase_order_1") + cls.po.location_id = cls.wh.wh_input_stock_loc_id -class TestThreeStepReception(common.TransactionCase): def test_three_steps_generate_three_pickings(self): - wh = self.env.ref("stock.warehouse0") - wh.reception_steps = "three_steps" - po = self.env.ref("purchase.purchase_order_1") - po.location_id = wh.wh_input_stock_loc_id - po.signal_workflow("purchase_confirm") + self.wh.reception_steps = "three_steps" + self.po.button_confirm() + self.assertEqual(1, self.po.picking_count) + self.assertEqual(3, self.po.all_picking_count) + + def test_action_view_all_pickings_one_step(self): + self.po.button_confirm() + action_data = self.po.action_view_all_pickings() + form_view = self.env.ref("stock.view_picking_form") + self.assertEqual(1, self.po.all_picking_count) + self.assertEqual(action_data["views"], [(form_view.id, "form")]) + self.assertEqual(action_data["res_id"], self.po.all_picking_ids.id) - self.assertEqual(1, po.shipment_count) - self.assertEqual(3, po.all_shipment_count) + def test_action_view_all_pickings_three_step(self): + self.wh.reception_steps = "three_steps" + self.po.button_confirm() + action_data = self.po.action_view_all_pickings() + self.assertEqual( + action_data["domain"], [("id", "in", self.po.all_picking_ids.ids)], + ) diff --git a/purchase_all_shipments/view/purchase_order.xml b/purchase_all_shipments/view/purchase_order.xml deleted file mode 100644 index ca7b784f03c..00000000000 --- a/purchase_all_shipments/view/purchase_order.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - purchase_order_form - purchase.order - - - - - - - 1 - - - - - diff --git a/purchase_all_shipments/views/purchase_order_views.xml b/purchase_all_shipments/views/purchase_order_views.xml new file mode 100644 index 00000000000..a80bee57d27 --- /dev/null +++ b/purchase_all_shipments/views/purchase_order_views.xml @@ -0,0 +1,36 @@ + + + + purchase.order.form + purchase.order + + + + + + + + 1 + + + + From dab8e96964df1dceabbf7a9cbc8d8dc4ad6bf8c0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 9 Dec 2020 19:01:43 +0000 Subject: [PATCH 18/36] [UPD] Update purchase_all_shipments.pot --- purchase_all_shipments/i18n/purchase_all_shipments.pot | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/purchase_all_shipments/i18n/purchase_all_shipments.pot b/purchase_all_shipments/i18n/purchase_all_shipments.pot index aacea707482..3f3285d96d4 100644 --- a/purchase_all_shipments/i18n/purchase_all_shipments.pot +++ b/purchase_all_shipments/i18n/purchase_all_shipments.pot @@ -4,10 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0+e\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-25 19:02+0000\n" -"PO-Revision-Date: 2020-08-25 19:02+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -22,7 +20,7 @@ msgid "All Pickings" msgstr "" #. module: purchase_all_shipments -#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_shipment_count +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_count msgid "All Pickings Count" msgstr "" From df21cfe73ae375813258bccc9221a40ff4343d74 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 9 Dec 2020 19:38:53 +0000 Subject: [PATCH 19/36] [UPD] README.rst --- purchase_all_shipments/README.rst | 34 +- .../static/description/index.html | 423 ++++++++++++++++++ 2 files changed, 444 insertions(+), 13 deletions(-) create mode 100644 purchase_all_shipments/static/description/index.html diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index f149907dddc..b54a5844d08 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -25,27 +25,36 @@ Purchase All Shipments |badge1| |badge2| |badge3| |badge4| |badge5| -With the core "purchase" module, in a purchase order a button "In Shipments" -lets the user see the picking that was generated by the order itself. +With the core "purchase" module, in a purchase order a button "In Shipments" lets the user see the picking that was generated by the order itself. -With this module, that button is replaced by an "All Shipments" button that -shows the original picking, and all others that are grouped with it. This -should include pickings associated to the procurements that generated the -purchase, and also pickings that have been chained with push rules. +With this module, that button is replaced by an "All Shipments" button that shows the original picking, and all others that are grouped with it. This should include pickings associated to the procurements that generated the purchase, and also pickings that have been chained with push rules. -This is consistent with the "sale" module, where from the sale order the user -can access the generated delivery and all chained ones. - -The implementation uses the procurement group of the moves in the generated -picking. The procurement group is always present in purchases, also when there -is no procurement. +This is consistent with the "sale" module, where from the sale order the user can access the generated delivery and all chained ones. +The implementation uses the procurement group of the moves in the generated picking. The procurement group is always present in purchases, also when there is no procurement. **Table of contents** .. contents:: :local: +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp Contributors ~~~~~~~~~~~~ @@ -69,4 +78,3 @@ promote its widespread use. This module is part of the `OCA/purchase-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. - diff --git a/purchase_all_shipments/static/description/index.html b/purchase_all_shipments/static/description/index.html new file mode 100644 index 00000000000..f7d2053432e --- /dev/null +++ b/purchase_all_shipments/static/description/index.html @@ -0,0 +1,423 @@ + + + + + + +Purchase All Shipments + + + +
+

Purchase All Shipments

+ + +

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runbot

+

With the core “purchase” module, in a purchase order a button “In Shipments” lets the user see the picking that was generated by the order itself.

+

With this module, that button is replaced by an “All Shipments” button that shows the original picking, and all others that are grouped with it. This should include pickings associated to the procurements that generated the purchase, and also pickings that have been chained with push rules.

+

This is consistent with the “sale” module, where from the sale order the user can access the generated delivery and all chained ones.

+

The implementation uses the procurement group of the moves in the generated picking. The procurement group is always present in purchases, also when there is no procurement.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/purchase-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From e938189821733b16103d71a32ed621984eaaeef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Thu, 5 Aug 2021 09:00:40 +0100 Subject: [PATCH 20/36] [IMP] *: pre-commit execution Fix pre-commit errors by addind the correct `website` key --- purchase_all_shipments/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/purchase_all_shipments/__manifest__.py b/purchase_all_shipments/__manifest__.py index a8886efc1d5..d9e21dd5349 100644 --- a/purchase_all_shipments/__manifest__.py +++ b/purchase_all_shipments/__manifest__.py @@ -4,6 +4,7 @@ "name": "Purchase All Shipments", "version": "13.0.1.0.0", "author": "Camptocamp,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/purchase-workflow", "category": "Purchases", "license": "AGPL-3", "depends": ["purchase_stock"], From 71f0aa9986eae17791fbb1388edc4b07647ba889 Mon Sep 17 00:00:00 2001 From: augusto-weiss Date: Thu, 12 Jan 2023 08:38:49 -0300 Subject: [PATCH 21/36] [IMP] purchase_all_shipments: pre-commit execution --- purchase_all_shipments/tests/test_three_step_reception.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchase_all_shipments/tests/test_three_step_reception.py b/purchase_all_shipments/tests/test_three_step_reception.py index a615ea1d3fb..959bc4c6b26 100644 --- a/purchase_all_shipments/tests/test_three_step_reception.py +++ b/purchase_all_shipments/tests/test_three_step_reception.py @@ -31,5 +31,6 @@ def test_action_view_all_pickings_three_step(self): self.po.button_confirm() action_data = self.po.action_view_all_pickings() self.assertEqual( - action_data["domain"], [("id", "in", self.po.all_picking_ids.ids)], + action_data["domain"], + [("id", "in", self.po.all_picking_ids.ids)], ) From 9442ae80a23ad5004413bafecf32d7ef4fd53a93 Mon Sep 17 00:00:00 2001 From: augusto-weiss Date: Thu, 12 Jan 2023 08:38:49 -0300 Subject: [PATCH 22/36] [MIG] purchase_all_shipments: Migration to 16.0 --- purchase_all_shipments/__manifest__.py | 2 +- .../models/purchase_order.py | 39 +++++++++++-------- .../tests/test_three_step_reception.py | 17 +++++--- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/purchase_all_shipments/__manifest__.py b/purchase_all_shipments/__manifest__.py index d9e21dd5349..f4659cea7b3 100644 --- a/purchase_all_shipments/__manifest__.py +++ b/purchase_all_shipments/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { "name": "Purchase All Shipments", - "version": "13.0.1.0.0", + "version": "16.0.1.0.0", "author": "Camptocamp,Odoo Community Association (OCA)", "website": "https://github.com/OCA/purchase-workflow", "category": "Purchases", diff --git a/purchase_all_shipments/models/purchase_order.py b/purchase_all_shipments/models/purchase_order.py index 9f481df2998..c54d10d2739 100644 --- a/purchase_all_shipments/models/purchase_order.py +++ b/purchase_all_shipments/models/purchase_order.py @@ -26,19 +26,26 @@ def _compute_all_pickings(self): rec.all_picking_ids = all_picking_ids def action_view_all_pickings(self): - """Similar to the view_picking method in the purchase module""" - action_data = self.env.ref("stock.action_picking_tree_all").read()[0] - pickings = self.mapped("all_picking_ids") - - # override the context to get rid of the default filtering on - # picking type - action_data["context"] = {} - - # choose the view_mode accordingly - if len(pickings) > 1: - action_data["domain"] = [("id", "in", pickings.ids)] - else: - form_view = self.env.ref("stock.view_picking_form") - action_data["views"] = [(form_view.id, "form")] - action_data["res_id"] = pickings.id - return action_data + return self._get_action_view_all_pickings(self.all_picking_ids) + + def _get_action_view_all_pickings(self, picking_ids): + """Similar to the _get_action_view_picking method in the purchase module""" + self.ensure_one() + result = self.env["ir.actions.actions"]._for_xml_id( + "stock.action_picking_tree_all" + ) + # override the context to get rid of the default filtering on picking type + result["context"] = {} + + if not picking_ids or len(picking_ids) > 1: + result["domain"] = [("id", "in", picking_ids.ids)] + elif len(picking_ids) == 1: + res = self.env.ref("stock.view_picking_form", False) + form_view = [(res and res.id or False, "form")] + result["views"] = form_view + [ + (state, view) + for state, view in result.get("views", []) + if view != "form" + ] + result["res_id"] = picking_ids.id + return result diff --git a/purchase_all_shipments/tests/test_three_step_reception.py b/purchase_all_shipments/tests/test_three_step_reception.py index 959bc4c6b26..7e7133e21da 100644 --- a/purchase_all_shipments/tests/test_three_step_reception.py +++ b/purchase_all_shipments/tests/test_three_step_reception.py @@ -1,21 +1,20 @@ # Copyright 2018 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from odoo.tests.common import SavepointCase +from odoo.tests.common import TransactionCase -class TestThreeStepReception(SavepointCase): +class TestThreeStepReception(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() cls.wh = cls.env.ref("stock.warehouse0") cls.po = cls.env.ref("purchase.purchase_order_1") - cls.po.location_id = cls.wh.wh_input_stock_loc_id def test_three_steps_generate_three_pickings(self): self.wh.reception_steps = "three_steps" self.po.button_confirm() - self.assertEqual(1, self.po.picking_count) + self.assertEqual(1, self.po.incoming_picking_count) self.assertEqual(3, self.po.all_picking_count) def test_action_view_all_pickings_one_step(self): @@ -23,7 +22,15 @@ def test_action_view_all_pickings_one_step(self): action_data = self.po.action_view_all_pickings() form_view = self.env.ref("stock.view_picking_form") self.assertEqual(1, self.po.all_picking_count) - self.assertEqual(action_data["views"], [(form_view.id, "form")]) + self.assertEqual( + action_data["views"], + [(form_view.id, "form")] + + [ + (state, view) + for state, view in action_data.get("views", []) + if view != "form" + ], + ) self.assertEqual(action_data["res_id"], self.po.all_picking_ids.id) def test_action_view_all_pickings_three_step(self): From ff33e81fe52c47059280387c964b72fbe4c91787 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 23 Mar 2023 17:34:21 +0000 Subject: [PATCH 23/36] [UPD] Update purchase_all_shipments.pot --- purchase_all_shipments/i18n/purchase_all_shipments.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_all_shipments/i18n/purchase_all_shipments.pot b/purchase_all_shipments/i18n/purchase_all_shipments.pot index 3f3285d96d4..26fc6f30fdc 100644 --- a/purchase_all_shipments/i18n/purchase_all_shipments.pot +++ b/purchase_all_shipments/i18n/purchase_all_shipments.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" From d270d5b8288e20c4822d37b5cf351664e9cbf38a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 23 Mar 2023 17:37:35 +0000 Subject: [PATCH 24/36] [UPD] README.rst --- purchase_all_shipments/README.rst | 10 +++++----- purchase_all_shipments/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index b54a5844d08..7828629fffa 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -14,13 +14,13 @@ Purchase All Shipments :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github - :target: https://github.com/OCA/purchase-workflow/tree/13.0/purchase_all_shipments + :target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_all_shipments :alt: OCA/purchase-workflow .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_all_shipments + :target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_all_shipments :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/142/13.0 + :target: https://runbot.odoo-community.org/runbot/142/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -44,7 +44,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -75,6 +75,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/purchase-workflow `_ project on GitHub. +This module is part of the `OCA/purchase-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_all_shipments/static/description/index.html b/purchase_all_shipments/static/description/index.html index f7d2053432e..5c4581a5fb4 100644 --- a/purchase_all_shipments/static/description/index.html +++ b/purchase_all_shipments/static/description/index.html @@ -367,7 +367,7 @@

Purchase All Shipments

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runbot

With the core “purchase” module, in a purchase order a button “In Shipments” lets the user see the picking that was generated by the order itself.

With this module, that button is replaced by an “All Shipments” button that shows the original picking, and all others that are grouped with it. This should include pickings associated to the procurements that generated the purchase, and also pickings that have been chained with push rules.

This is consistent with the “sale” module, where from the sale order the user can access the generated delivery and all chained ones.

@@ -389,7 +389,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -414,7 +414,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/purchase-workflow project on GitHub.

+

This module is part of the OCA/purchase-workflow project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 14e2316d4f45f68a481d1932acd070b0799f6ba2 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 23 Mar 2023 20:11:11 +0000 Subject: [PATCH 25/36] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_all_shipments Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_all_shipments/ --- purchase_all_shipments/i18n/es.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchase_all_shipments/i18n/es.po b/purchase_all_shipments/i18n/es.po index 6560db09c42..8bbb3c1ab7f 100644 --- a/purchase_all_shipments/i18n/es.po +++ b/purchase_all_shipments/i18n/es.po @@ -10,6 +10,7 @@ msgstr "" "PO-Revision-Date: 2020-08-25 19:03+0000\n" "Last-Translator: \n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -22,7 +23,7 @@ msgid "All Pickings" msgstr "En recepciones" #. module: purchase_all_shipments -#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_shipment_count +#: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_count msgid "All Pickings Count" msgstr "" From a6226391a90ef5bd03dcdca4935a28c71b3bd453 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Thu, 20 Jul 2023 09:09:05 +0000 Subject: [PATCH 26/36] Translated using Weblate (Spanish) Currently translated at 100.0% (4 of 4 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_all_shipments Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_all_shipments/es/ --- purchase_all_shipments/i18n/es.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/purchase_all_shipments/i18n/es.po b/purchase_all_shipments/i18n/es.po index 8bbb3c1ab7f..2d05a12cdb9 100644 --- a/purchase_all_shipments/i18n/es.po +++ b/purchase_all_shipments/i18n/es.po @@ -7,14 +7,15 @@ msgstr "" "Project-Id-Version: Odoo Server 13.0+e\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-25 19:03+0000\n" -"PO-Revision-Date: 2020-08-25 19:03+0000\n" -"Last-Translator: \n" +"PO-Revision-Date: 2023-07-20 10:15+0000\n" +"Last-Translator: Ivorra78 \n" "Language-Team: \n" -"Language: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: purchase_all_shipments #: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_ids @@ -25,7 +26,7 @@ msgstr "En recepciones" #. module: purchase_all_shipments #: model:ir.model.fields,field_description:purchase_all_shipments.field_purchase_order__all_picking_count msgid "All Pickings Count" -msgstr "" +msgstr "Contador de todas las recepciones" #. module: purchase_all_shipments #: model_terms:ir.ui.view,arch_db:purchase_all_shipments.purchase_order_view_form_inherit From 8c493cf7a96f47097520aad3bab36862b93dfb71 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 15:50:22 +0000 Subject: [PATCH 27/36] [UPD] README.rst --- purchase_all_shipments/README.rst | 15 ++++---- .../static/description/index.html | 34 ++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/purchase_all_shipments/README.rst b/purchase_all_shipments/README.rst index 7828629fffa..860f37e9d06 100644 --- a/purchase_all_shipments/README.rst +++ b/purchase_all_shipments/README.rst @@ -2,10 +2,13 @@ Purchase All Shipments ====================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:dad958ce9e424a4848c82ce7b0c64e7b30d7c2855ccb0deed445073571a58ea3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Purchase All Shipments .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_all_shipments :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/142/16.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| With the core "purchase" module, in a purchase order a button "In Shipments" lets the user see the picking that was generated by the order itself. @@ -43,7 +46,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/purchase_all_shipments/static/description/index.html b/purchase_all_shipments/static/description/index.html index 5c4581a5fb4..eed108e26d0 100644 --- a/purchase_all_shipments/static/description/index.html +++ b/purchase_all_shipments/static/description/index.html @@ -1,20 +1,20 @@ - + - + Purchase All Shipments