From f350adcee324d06c64160b5ed20adcfed0400f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 6 Aug 2024 16:51:57 +0200 Subject: [PATCH] Remove "Parties associated to Purchases" menu entry Closes #6935 --- modules/purchase/CHANGELOG | 1 + modules/purchase/__init__.py | 1 - .../purchase/doc/usage/prepurchase.inc.rst | 19 -------------- modules/purchase/purchase.py | 26 +------------------ modules/purchase/purchase.xml | 12 --------- 5 files changed, 2 insertions(+), 57 deletions(-) diff --git a/modules/purchase/CHANGELOG b/modules/purchase/CHANGELOG index 209c9fd878..97c157e3eb 100644 --- a/modules/purchase/CHANGELOG +++ b/modules/purchase/CHANGELOG @@ -1,3 +1,4 @@ +* Remove "Parties associated to Purchases" menu entry * Permit only purchase line of type line as stock move origin Version 7.2.0 - 2024-04-29 diff --git a/modules/purchase/__init__.py b/modules/purchase/__init__.py index 998caa3a7b..619e3a9293 100644 --- a/modules/purchase/__init__.py +++ b/modules/purchase/__init__.py @@ -49,7 +49,6 @@ def register(): purchase.PurchaseReport, module='purchase', type_='report') Pool.register( - purchase.OpenSupplier, purchase.HandleShipmentException, purchase.HandleInvoiceException, party.PartyReplace, diff --git a/modules/purchase/doc/usage/prepurchase.inc.rst b/modules/purchase/doc/usage/prepurchase.inc.rst index 53687a1ad5..36bd64e210 100644 --- a/modules/purchase/doc/usage/prepurchase.inc.rst +++ b/modules/purchase/doc/usage/prepurchase.inc.rst @@ -1,22 +1,3 @@ -.. _Listing Suppliers: - -Listing Suppliers -================= - -In Tryton, by definition, the `Parties ` that your -`Company ` has bought from are its suppliers. -The *Purchase Module* lets you list these when you open the -[:menuselection:`Parties --> Parties --> Associated to Purchases`] -main menu item. - -.. tip:: - - For some companies it is important to know which parties are, or may - eventually be, suppliers before you have bought anything from them. - One way of doing this is to create a ``Supplier`` - `Category `, and add all the appropriate - parties to it. - .. _Making products purchasable: Making products purchasable diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index 8d25d34439..9923613f78 100644 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -26,7 +26,7 @@ from trytond.modules.company.model import ( from trytond.modules.currency.fields import Monetary from trytond.modules.product import price_digits from trytond.pool import Pool -from trytond.pyson import Bool, Eval, If, PYSONEncoder +from trytond.pyson import Bool, Eval, If from trytond.tools import cached_property, firstline from trytond.transaction import Transaction from trytond.wizard import ( @@ -2206,30 +2206,6 @@ class PurchaseReport(CompanyReport): return context -class OpenSupplier(Wizard): - 'Open Suppliers' - __name__ = 'purchase.open_supplier' - start_state = 'open_' - open_ = StateAction('party.act_party_form') - - def do_open_(self, action): - pool = Pool() - ModelData = pool.get('ir.model.data') - Wizard = pool.get('ir.action.wizard') - Purchase = pool.get('purchase.purchase') - cursor = Transaction().connection.cursor() - purchase = Purchase.__table__() - - cursor.execute(*purchase.select(purchase.party, - group_by=purchase.party)) - supplier_ids = [line[0] for line in cursor] - action['pyson_domain'] = PYSONEncoder().encode( - [('id', 'in', supplier_ids)]) - wizard = Wizard(ModelData.get_id('purchase', 'act_open_supplier')) - action['name'] = wizard.name - return action, {} - - class HandleShipmentExceptionAsk(ModelView): 'Handle Shipment Exception' __name__ = 'purchase.handle.shipment.exception.ask' diff --git a/modules/purchase/purchase.xml b/modules/purchase/purchase.xml index a7f129aed4..3d620e8c85 100644 --- a/modules/purchase/purchase.xml +++ b/modules/purchase/purchase.xml @@ -624,18 +624,6 @@ this repository contains the full copyright notices and license terms. --> - - Parties associated to Purchases - purchase.open_supplier - - - Modify Header purchase.modify_header