Skip to content

Commit 1b65d21

Browse files
committed
[ADD] purchase_supplier_approved
1 parent da5ff00 commit 1b65d21

29 files changed

+3005
-0
lines changed
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
===========================
2+
Purchase Approved Suppliers
3+
===========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:fc8e60a95aeb7e1b6f8d6858350f45c61a02a44ed54ddc40533beb85de26adf9
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_supplier_approved
21+
:alt: OCA/purchase-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_supplier_approved
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows to define approved suppliers for each product and
32+
validates purchase orders against these approvals.
33+
34+
Features
35+
36+
- Define approved suppliers for each product with validity dates
37+
- Configure approved supplier requirements per Product Category
38+
- Set individual product exceptions to override category settings
39+
- Security group "Manage Approved Suppliers" to control who can manage
40+
approvals
41+
- Smart buttons on Product Template and Partner forms to view related
42+
approvals
43+
- Warning when adding unapproved suppliers to purchase orders
44+
- Validation that blocks purchase order confirmation if suppliers are
45+
not approved
46+
- Override mechanism for authorized users with mandatory reason
47+
48+
**Table of contents**
49+
50+
.. contents::
51+
:local:
52+
53+
Configuration
54+
=============
55+
56+
User Permissions
57+
58+
1. Go to Settings > Users & Companies > Groups
59+
2. Assign users to the "Manage Approved Suppliers" group to allow them
60+
to:
61+
62+
- Create and manage approved supplier records
63+
- Override purchase order validations
64+
- Configure approved supplier requirements on categories and
65+
products
66+
- See approved supplier fields on product and partner forms
67+
68+
Product Category Configuration
69+
70+
1. Go to Products > Product Categories
71+
2. Select a category and set "Require Approved Suppliers" to:
72+
73+
- Checked: All products in this category require approved suppliers
74+
- Unchecked: Products in this category don't require approved
75+
suppliers
76+
77+
Product Exception Configuration
78+
79+
1. Go to Products > Product Templates
80+
81+
2. Open a product and go to the Purchase tab
82+
83+
3. Set "Approved Supplier Requirement" to:
84+
85+
- "Use Category Setting": Follow the category configuration
86+
(default)
87+
- "Required": This product requires approved suppliers regardless of
88+
category
89+
- "Not Required": This product doesn't require approved suppliers
90+
regardless of category
91+
92+
4. The "Require Approved Suppliers" field shows the effective
93+
requirement based on:
94+
95+
- Category setting
96+
- Product exception override
97+
- Computed result for easy verification
98+
99+
Usage
100+
=====
101+
102+
Managing Approved Suppliers
103+
104+
1. Go to Purchase > Products > Approved Suppliers
105+
2. Create new approved supplier records with:
106+
107+
- Supplier (Partner)
108+
- Product Template
109+
- Valid From date
110+
- Valid To date (optional)
111+
- Active status
112+
113+
From Product Template
114+
115+
1. Open any product template
116+
2. Click the "Approved Suppliers" smart button to view/manage approvals
117+
for that product
118+
3. In the Purchase tab, you can:
119+
120+
- Configure the approved supplier requirement (override category
121+
setting)
122+
- View the effective requirement (computed field)
123+
- Directly add approved suppliers (if you have the right
124+
permissions)
125+
126+
Understanding Effective Requirements
127+
128+
The system determines if approved suppliers are required based on:
129+
130+
1. **Product Exception**: If set to "Required" or "Not Required", this
131+
overrides the category
132+
2. **Category Setting**: If no product exception, uses the category
133+
configuration
134+
3. **Default**: If no category is set, approved suppliers are not
135+
required
136+
137+
The "Require Approved Suppliers" field on products shows the computed
138+
result for easy verification.
139+
140+
From Partner
141+
142+
1. Open any supplier partner
143+
2. Click the "Approved Products" smart button to view/manage products
144+
for which this partner is approved
145+
3. In the Purchase tab, you can also directly add approved products (if
146+
you have the right permissions)
147+
148+
Purchase Order Validation
149+
150+
1. When creating purchase orders, the system will:
151+
152+
- Show warnings when adding products with unapproved suppliers
153+
- Display a warning banner if the PO contains unapproved suppliers
154+
- Block confirmation if any product has an unapproved supplier
155+
156+
2. Users with "Manage Approved Suppliers" permissions can:
157+
158+
- Enable "Override Supplier Approval" checkbox
159+
- Provide a mandatory reason for the override
160+
- Confirm the purchase order despite unapproved suppliers
161+
162+
Bug Tracker
163+
===========
164+
165+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
166+
In case of trouble, please check there if your issue has already been reported.
167+
If you spotted it first, help us to smash it by providing a detailed and welcomed
168+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_supplier_approved%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
169+
170+
Do not contact contributors directly about support or help with technical issues.
171+
172+
Credits
173+
=======
174+
175+
Authors
176+
-------
177+
178+
* Open Source Integrators
179+
180+
Contributors
181+
------------
182+
183+
Credits
184+
-------
185+
186+
Authors
187+
~~~~~~~
188+
189+
- Open Source Integrators
190+
191+
Contributors
192+
~~~~~~~~~~~~
193+
194+
- Open Source Integrators
195+
196+
Maintainers
197+
~~~~~~~~~~~
198+
199+
This module is maintained by the OCA.
200+
201+
|OCA|
202+
203+
OCA, or the Odoo Community Association, is a nonprofit organization
204+
whose mission is to support the collaborative development of Odoo
205+
features and promote its widespread use.
206+
207+
This module is part of the
208+
`OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_supplier_approved>`__
209+
project on GitHub.
210+
211+
You are welcome to contribute. To learn how please visit
212+
https://odoo-community.org/page/Contribute.
213+
214+
.. |OCA| image:: https://odoo-community.org/logo.png
215+
216+
Maintainers
217+
-----------
218+
219+
This module is maintained by the OCA.
220+
221+
.. image:: https://odoo-community.org/logo.png
222+
:alt: Odoo Community Association
223+
:target: https://odoo-community.org
224+
225+
OCA, or the Odoo Community Association, is a nonprofit organization whose
226+
mission is to support the collaborative development of Odoo features and
227+
promote its widespread use.
228+
229+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_supplier_approved>`_ project on GitHub.
230+
231+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Open Source Integrators
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
4+
from . import models
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025 Open Source Integrators
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
4+
{
5+
"name": "Purchase Approved Suppliers",
6+
"version": "17.0.1.0.0",
7+
"category": "Purchase",
8+
"author": "Open Source Integrators, Odoo Community Association (OCA)",
9+
"website": "https://github.com/OCA/purchase-workflow",
10+
"license": "LGPL-3",
11+
"depends": [
12+
"purchase",
13+
"product",
14+
],
15+
"data": [
16+
"security/security.xml",
17+
"security/ir.model.access.csv",
18+
"views/purchase_supplier_approved_views.xml",
19+
"views/product_category_views.xml",
20+
"views/product_template_views.xml",
21+
"views/res_partner_views.xml",
22+
"views/purchase_order_views.xml",
23+
"views/menu.xml",
24+
],
25+
"demo": [
26+
"demo/purchase_supplier_approved_demo.xml",
27+
],
28+
"installable": True,
29+
"auto_install": False,
30+
"application": False,
31+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- Copyright 2025 Open Source Integrators -->
3+
<!-- License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
4+
<odoo noupdate="1">
5+
6+
<!-- Demo Product Categories -->
7+
<record id="product_category_all" model="product.category">
8+
<field name="name">All</field>
9+
<field name="require_approved_supplier" eval="False" />
10+
</record>
11+
12+
<record id="product_category_components" model="product.category">
13+
<field name="name">Components</field>
14+
<field name="parent_id" ref="product_category_all" />
15+
<field name="require_approved_supplier" eval="True" />
16+
</record>
17+
18+
<record id="product_category_services" model="product.category">
19+
<field name="name">Services</field>
20+
<field name="parent_id" ref="product_category_all" />
21+
<field name="require_approved_supplier" eval="False" />
22+
</record>
23+
24+
<!-- Demo Products -->
25+
<record id="demo_product_component_1" model="product.template">
26+
<field name="name">Demo Component 1</field>
27+
<field name="categ_id" ref="product_category_components" />
28+
<field name="purchase_ok" eval="True" />
29+
<field name="type">product</field>
30+
<field name="uom_id" ref="uom.product_uom_unit" />
31+
<field name="uom_po_id" ref="uom.product_uom_unit" />
32+
</record>
33+
34+
<record id="demo_product_component_2" model="product.template">
35+
<field name="name">Demo Component 2</field>
36+
<field name="categ_id" ref="product_category_components" />
37+
<field name="purchase_ok" eval="True" />
38+
<field name="type">product</field>
39+
<field name="uom_id" ref="uom.product_uom_unit" />
40+
<field name="uom_po_id" ref="uom.product_uom_unit" />
41+
</record>
42+
43+
<record id="demo_product_service" model="product.template">
44+
<field name="name">Demo Service</field>
45+
<field name="categ_id" ref="product_category_services" />
46+
<field name="approved_supplier_requirement">required</field>
47+
<field name="purchase_ok" eval="True" />
48+
<field name="type">service</field>
49+
<field name="uom_id" ref="uom.product_uom_unit" />
50+
<field name="uom_po_id" ref="uom.product_uom_unit" />
51+
</record>
52+
53+
<!-- Demo Approved Suppliers -->
54+
<record id="demo_approved_supplier_1" model="purchase.supplier.approved">
55+
<field name="partner_id" ref="base.res_partner_1" />
56+
<field name="product_tmpl_id" ref="demo_product_component_1" />
57+
<field
58+
name="date_from"
59+
eval="(DateTime.now() - timedelta(days=30)).strftime('%Y-%m-%d')"
60+
/>
61+
<field name="active">True</field>
62+
</record>
63+
64+
<record id="demo_approved_supplier_2" model="purchase.supplier.approved">
65+
<field name="partner_id" ref="base.res_partner_3" />
66+
<field name="product_tmpl_id" ref="demo_product_component_2" />
67+
<field
68+
name="date_from"
69+
eval="(DateTime.now() - timedelta(days=60)).strftime('%Y-%m-%d')"
70+
/>
71+
<field
72+
name="date_to"
73+
eval="(DateTime.now() + timedelta(days=365)).strftime('%Y-%m-%d')"
74+
/>
75+
<field name="active">True</field>
76+
</record>
77+
78+
<record id="demo_approved_supplier_3" model="purchase.supplier.approved">
79+
<field name="partner_id" ref="base.res_partner_12" />
80+
<field name="product_tmpl_id" ref="demo_product_service" />
81+
<field name="date_from" eval="DateTime.now().strftime('%Y-%m-%d')" />
82+
<field name="active">True</field>
83+
</record>
84+
85+
</odoo>

0 commit comments

Comments
 (0)