Add oca-purchase submodule with 96 purchase modules moved from oca-workflow-process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ernad Husremovic 2025-08-30 18:00:40 +02:00
parent b0628ee8ea
commit 7378b233e9
3994 changed files with 334316 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Purchase Minimum Amount
Odoo addon: purchase_minimum_amount
## Installation
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_minimum_amount
```
## Dependencies
This addon depends on:
- purchase_order_approval_block
## Manifest Information
- **Name**: Purchase Minimum Amount
- **Version**: 16.0.1.0.0
- **Category**: N/A
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/purchase-workflow](https://github.com/OCA/purchase-workflow) branch 16.0, addon `purchase_minimum_amount`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Purchase_minimum_amount Module - purchase_minimum_amount
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for purchase_minimum_amount. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [purchase_order_approval_block](https://github.com/bringout/oca-workflow-process)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon purchase_minimum_amount or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_minimum_amount"
# or
uv pip install odoo-bringout-oca-purchase-workflow-purchase_minimum_amount"
```

View file

@ -0,0 +1,14 @@
# Models
Detected core models and extensions in purchase_minimum_amount.
```mermaid
classDiagram
class purchase_order
class purchase_order_line
class res_partner
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: purchase_minimum_amount. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon purchase_minimum_amount
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon purchase_minimum_amount
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,133 @@
=======================
Purchase Minimum Amount
=======================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ab05f36d17308926281dc7fa679ef2166f78174c06812a21c9287cb59b0ee9b8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/purchase_minimum_amount
: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-16-0/purchase-workflow-16-0-purchase_minimum_amount
:alt: Translate me on Weblate
.. |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|
This module allows you to establish and automate a specific Purchase Order
Approval Block Reason in the system: the 'Minimum Purchase Order Amount per
Vendor'.
**Table of contents**
.. contents::
:local:
Configuration
=============
* Go to 'Purchases / Purchase / Vendors'
* Click on a Vendor and inside the 'Sales & Purchases' page specify the
non-required field 'Minimum Purchase Amount'.
* Assign the security group 'Release RFQ with approval block' to users that
should be able to release the block. Users in group 'Purchase / Managers'
are by default assigned to this group.
Usage
=====
Set the Purchase Approval Block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Go to 'Purchases / Purchase / Requests for Quotation'
#. Create a new RFQ and upon saving if the Untaxed Amount is below the
Purchase Minimum Amount specified in that vendor, then the Approval Block
Reason is automatically set and the Approval Block Reason is not editable
anymore.
Search existing RFQ
~~~~~~~~~~~~~~~~~~~
There is a filter 'Blocked' to search for orders that are blocked.
It is also possible to search RFQs with the Approval Block Reason 'Minimum
Purchase Order Amount per Vendor'.
Confirm the RFQ
~~~~~~~~~~~~~~~
#. Press the button Confirm. If theres an approval block, the order will
be set to status 'To Approve'. You will then need to request a Purchase
Manager to approve it.
Release the purchase approval block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. All the RFQs with a total amount surpassing the specified Minimum Purchase
Order Amount for that vendor (excluding taxes) are automatically released.
#. If a blocked RFQ without surpassing the minimum amount wants to be
released, a user member of the security group 'Release RFQ with approval
block' can see a button 'Release Approval Block'. When pressing it, anyone
seeing that RFQ is able to validate it.
Notifications to followers
~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Followers of the RFQ receive notifications when an approval block has been
set or released.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_minimum_amount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* ForgeFlow
Contributors
~~~~~~~~~~~~
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
* Roser Garcia <roser.garcia@forgeflow.com>
* Darshan Patel <darshan.patel.serpentcs@gmail.com>
* Nikul Chaudhary <nikulchaudhary2112@gmail.com>
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.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_minimum_amount>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
from . import models

View file

@ -0,0 +1,17 @@
# Copyright 2016 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
{
"name": "Purchase Minimum Amount",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"version": "16.0.1.0.0",
"website": "https://github.com/OCA/purchase-workflow",
"depends": ["purchase_order_approval_block"],
"data": [
"data/purchase_block_reason_data.xml",
"views/purchase_order_view.xml",
"views/res_partner_view.xml",
],
"license": "AGPL-3",
"installable": True,
}

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2017 ForgeFlow S.L.
Copyright 2017 Serpent Consulting Services Pvt. Ltd.
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="minimum_amount_block_reason" model="purchase.approval.block.reason">
<field name="name">Minimum Amount per Vendor</field>
<field
name="description"
>Set total minimum amount (before taxes) for a vendor.</field>
</record>
</odoo>

View file

@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \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_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr "Kontakt"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr "Minimum Nabavni Iznos"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr "Nabavni Minimum Iznos"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr "Nalog za nabavu"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka naloga za nabavu"

View file

@ -0,0 +1,66 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2018-02-23 17:50+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2018\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Bestellposition"

View file

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2024-04-17 19:34+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr "Contacto"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr "ID"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr "Importe mínimo de compra"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr "Importe mínimo de compra"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr "Orden de compra"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea orden de compra"

View file

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2018-02-23 17:50+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2018\n"
"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/"
"es_MX/)\n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea de orden de compra"

View file

@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
# Quentin THEURET <odoo@kerpeo.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2020-08-28 17:00+0000\n"
"Last-Translator: Sandie FAVRE <sandie.favre@grap.coop>\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.10\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr "Contact"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr "Montant minimum d'achat"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr "Montant minimum d'achat"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr "Commande"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ligne de commande d'achat"

View file

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2024-01-29 17:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr "Contatto"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr "ID"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr "Importo minimo acquisto"
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr "Importo minimo acquisto"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"

View file

@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2022-10-03 17:36+0000\n"
"Last-Translator: Douglas Custódio <douglascstd@yahoo.com>\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
"teams/23907/pt_BR/)\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linha do Pedido de Compra"

View file

@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \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_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""

View file

@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_minimum_amount
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 17:50+0000\n"
"PO-Revision-Date: 2020-08-12 15:59+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@matmoz.si>\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 3.10\n"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_res_partner
msgid "Contact"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__display_name
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__display_name
msgid "Display Name"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line__id
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__id
msgid "ID"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order_line____last_update
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner____last_update
msgid "Last Modified on"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_partner__minimum_po_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_res_users__minimum_po_amount
msgid "Minimum Purchase Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model.fields,field_description:purchase_minimum_amount.field_purchase_order__minimum_po_amount
msgid "Purchase Minimum Amount"
msgstr ""
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order
msgid "Purchase Order"
msgstr "Nabavni nalog"
#. module: purchase_minimum_amount
#: model:ir.model,name:purchase_minimum_amount.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Postavka nabavnega naloga"

View file

@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import purchase_order
from . import partner

View file

@ -0,0 +1,11 @@
# Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
minimum_po_amount = fields.Float("Minimum Purchase Amount")

View file

@ -0,0 +1,57 @@
# Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
minimum_po_amount = fields.Float(
related="partner_id.minimum_po_amount",
string="Purchase Minimum Amount",
)
@api.constrains("partner_id")
def _check_minimum_amount(self):
for rec in self:
po_amt_block = rec.env.ref(
"purchase_minimum_amount." "minimum_amount_block_reason",
raise_if_not_found=False,
)
under_min = rec.amount_untaxed < rec.minimum_po_amount
force_release = rec.env.context.get(
"force_po_approval_block_release", False
)
if under_min and not rec.approval_block_id and not force_release:
rec.approval_block_id = po_amt_block
elif not under_min and rec.approval_block_id == po_amt_block:
rec.approval_block_id = False
return True
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
@api.model
def _check_minimum_amount_fields(self):
"""As we are adding a hook, we cannot use api.constrain"""
return ["product_qty", "price_unit"]
@api.model_create_multi
def create(self, mvals):
records = super(PurchaseOrderLine, self).create(mvals)
fields = self._check_minimum_amount_fields()
for vals, res in zip(mvals, records):
if any(field in vals for field in fields):
res.order_id._check_minimum_amount()
return records
def write(self, vals):
res = super(PurchaseOrderLine, self).write(vals)
fields = self._check_minimum_amount_fields()
for rec in self:
if any(field in vals for field in fields):
rec.order_id._check_minimum_amount()
return res

View file

@ -0,0 +1,6 @@
* Go to 'Purchases / Purchase / Vendors'
* Click on a Vendor and inside the 'Sales & Purchases' page specify the
non-required field 'Minimum Purchase Amount'.
* Assign the security group 'Release RFQ with approval block' to users that
should be able to release the block. Users in group 'Purchase / Managers'
are by default assigned to this group.

View file

@ -0,0 +1,4 @@
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
* Roser Garcia <roser.garcia@forgeflow.com>
* Darshan Patel <darshan.patel.serpentcs@gmail.com>
* Nikul Chaudhary <nikulchaudhary2112@gmail.com>

View file

@ -0,0 +1,3 @@
This module allows you to establish and automate a specific Purchase Order
Approval Block Reason in the system: the 'Minimum Purchase Order Amount per
Vendor'.

View file

@ -0,0 +1,38 @@
Set the Purchase Approval Block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Go to 'Purchases / Purchase / Requests for Quotation'
#. Create a new RFQ and upon saving if the Untaxed Amount is below the
Purchase Minimum Amount specified in that vendor, then the Approval Block
Reason is automatically set and the Approval Block Reason is not editable
anymore.
Search existing RFQ
~~~~~~~~~~~~~~~~~~~
There is a filter 'Blocked' to search for orders that are blocked.
It is also possible to search RFQs with the Approval Block Reason 'Minimum
Purchase Order Amount per Vendor'.
Confirm the RFQ
~~~~~~~~~~~~~~~
#. Press the button Confirm. If theres an approval block, the order will
be set to status 'To Approve'. You will then need to request a Purchase
Manager to approve it.
Release the purchase approval block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. All the RFQs with a total amount surpassing the specified Minimum Purchase
Order Amount for that vendor (excluding taxes) are automatically released.
#. If a blocked RFQ without surpassing the minimum amount wants to be
released, a user member of the security group 'Release RFQ with approval
block' can see a button 'Release Approval Block'. When pressing it, anyone
seeing that RFQ is able to validate it.
Notifications to followers
~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Followers of the RFQ receive notifications when an approval block has been
set or released.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,493 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Purchase Minimum Amount</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="purchase-minimum-amount">
<h1 class="title">Purchase Minimum Amount</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ab05f36d17308926281dc7fa679ef2166f78174c06812a21c9287cb59b0ee9b8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_minimum_amount"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_minimum_amount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to establish and automate a specific Purchase Order
Approval Block Reason in the system: the Minimum Purchase Order Amount per
Vendor.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a><ul>
<li><a class="reference internal" href="#set-the-purchase-approval-block" id="toc-entry-3">Set the Purchase Approval Block</a></li>
<li><a class="reference internal" href="#search-existing-rfq" id="toc-entry-4">Search existing RFQ</a></li>
<li><a class="reference internal" href="#confirm-the-rfq" id="toc-entry-5">Confirm the RFQ</a></li>
<li><a class="reference internal" href="#release-the-purchase-approval-block" id="toc-entry-6">Release the purchase approval block</a></li>
<li><a class="reference internal" href="#notifications-to-followers" id="toc-entry-7">Notifications to followers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-8">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-9">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-10">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-11">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-12">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ul class="simple">
<li>Go to Purchases / Purchase / Vendors</li>
<li>Click on a Vendor and inside the Sales &amp; Purchases page specify the
non-required field Minimum Purchase Amount.</li>
<li>Assign the security group Release RFQ with approval block to users that
should be able to release the block. Users in group Purchase / Managers
are by default assigned to this group.</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<div class="section" id="set-the-purchase-approval-block">
<h2><a class="toc-backref" href="#toc-entry-3">Set the Purchase Approval Block</a></h2>
<ol class="arabic simple">
<li>Go to Purchases / Purchase / Requests for Quotation</li>
<li>Create a new RFQ and upon saving if the Untaxed Amount is below the
Purchase Minimum Amount specified in that vendor, then the Approval Block
Reason is automatically set and the Approval Block Reason is not editable
anymore.</li>
</ol>
</div>
<div class="section" id="search-existing-rfq">
<h2><a class="toc-backref" href="#toc-entry-4">Search existing RFQ</a></h2>
<p>There is a filter Blocked to search for orders that are blocked.
It is also possible to search RFQs with the Approval Block Reason Minimum
Purchase Order Amount per Vendor.</p>
</div>
<div class="section" id="confirm-the-rfq">
<h2><a class="toc-backref" href="#toc-entry-5">Confirm the RFQ</a></h2>
<ol class="arabic simple">
<li>Press the button Confirm. If theres an approval block, the order will
be set to status To Approve. You will then need to request a Purchase
Manager to approve it.</li>
</ol>
</div>
<div class="section" id="release-the-purchase-approval-block">
<h2><a class="toc-backref" href="#toc-entry-6">Release the purchase approval block</a></h2>
<ol class="arabic simple">
<li>All the RFQs with a total amount surpassing the specified Minimum Purchase
Order Amount for that vendor (excluding taxes) are automatically released.</li>
<li>If a blocked RFQ without surpassing the minimum amount wants to be
released, a user member of the security group Release RFQ with approval
block can see a button Release Approval Block. When pressing it, anyone
seeing that RFQ is able to validate it.</li>
</ol>
</div>
<div class="section" id="notifications-to-followers">
<h2><a class="toc-backref" href="#toc-entry-7">Notifications to followers</a></h2>
<ol class="arabic simple">
<li>Followers of the RFQ receive notifications when an approval block has been
set or released.</li>
</ol>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-8">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_minimum_amount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-9">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-10">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-11">Contributors</a></h2>
<ul class="simple">
<li>Jordi Ballester Alomar &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
<li>Roser Garcia &lt;<a class="reference external" href="mailto:roser.garcia&#64;forgeflow.com">roser.garcia&#64;forgeflow.com</a>&gt;</li>
<li>Darshan Patel &lt;<a class="reference external" href="mailto:darshan.patel.serpentcs&#64;gmail.com">darshan.patel.serpentcs&#64;gmail.com</a>&gt;</li>
<li>Nikul Chaudhary &lt;<a class="reference external" href="mailto:nikulchaudhary2112&#64;gmail.com">nikulchaudhary2112&#64;gmail.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-12">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_minimum_amount">OCA/purchase-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import test_po_minimum_amount_block

View file

@ -0,0 +1,127 @@
# Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import time
from odoo.tests.common import TransactionCase
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class TestPoAmountBlock(TransactionCase):
def setUp(self):
super(TestPoAmountBlock, self).setUp()
self.users_obj = self.env["res.users"]
self.po_obj = self.env["purchase.order"]
self.po_block_obj = self.env["purchase.approval.block.reason"]
# company
self.company1 = self.env.ref("base.main_company")
# groups
self.group_purchase_user = self.env.ref("purchase.group_purchase_user")
self.group_purchase_manager = self.env.ref("purchase.group_purchase_manager")
# Partner
self.partner1 = self.env["res.partner"].create(
{
"name": "Partner",
}
)
# Products
self.product1 = self.env["product.product"].create({"name": "Product 1"})
self.product2 = self.env["product.product"].create({"name": "Product 2"})
self.product3 = self.env["product.product"].create({"name": "Product 3"})
# Create users
self.user1_id = self._create_user(
"user_1",
[self.group_purchase_user],
self.company1,
)
self.user2_id = self._create_user(
"user_2",
[self.group_purchase_manager],
self.company1,
)
def _create_user(self, login, groups, company):
"""Create a user."""
group_ids = [group.id for group in groups]
user = self.users_obj.with_context(no_reset_password=True).create(
{
"name": "Purchase User",
"login": login,
"password": "test",
"email": "test@yourcompany.com",
"company_id": company.id,
"company_ids": [(4, company.id)],
"groups_id": [(6, 0, group_ids)],
}
)
return user.id
def _create_purchase(self, line_products):
"""Create a purchase order.
``line_products`` is a list of tuple [(product, qty)]
"""
lines = []
for product, qty in line_products:
line_values = {
"name": product.name,
"product_id": product.id,
"product_qty": qty,
"product_uom": product.uom_id.id,
"price_unit": 100,
"date_planned": time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
}
lines.append((0, 0, line_values))
purchase = self.po_obj.create(
{
"partner_id": self.partner1.id,
"approval_block_id": self.po_block_obj.id,
"order_line": lines,
"company_id": self.company1.id,
}
)
return purchase
def test_po_amount_block_under_minimum_manager_user_release(self):
"""Test PO Block for Minimum Threshold Vendor Amount"""
self.partner1.write({"minimum_po_amount": 1500.00})
# Create a PO with an amount below the minimum and check that the
# Approval Block Reason is correctly assign
purchase1 = self._create_purchase(
[(self.product1, 1), (self.product2, 5), (self.product3, 8)]
)
self.assertEqual(
purchase1.approval_block_id,
self.env.ref("purchase_minimum_amount.minimum_amount_block_reason"),
)
purchase1.with_user(self.user1_id).button_confirm()
self.assertEqual(purchase1.state, "draft")
# Release the PO by pressing the button and then confirming the order
purchase1.with_user(self.user2_id).button_release_approval_block()
purchase1.button_confirm()
self.assertEqual(purchase1.state, "purchase")
def test_po_amount_block_above_minimum_group_user(self):
"""Test PO Block for Minimum Threshold Vendor Amount"""
self.partner1.write({"minimum_po_amount": 1500.00})
purchase1 = self._create_purchase(
[(self.product1, 1), (self.product2, 5), (self.product3, 8)]
)
self.assertEqual(
purchase1.approval_block_id,
self.env.ref("purchase_minimum_amount.minimum_amount_block_reason"),
)
for po_line in purchase1.order_line:
if po_line.product_id == self.product1:
po_line.product_qty = 10
purchase1.flush_recordset()
self.assertFalse(purchase1.approval_block_id)
purchase1.with_user(self.user1_id).button_confirm()
self.assertEqual(purchase1.state, "purchase")

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2017 ForgeFlow S.L.
Copyright 2017 Serpent Consulting Services Pvt. Ltd.
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="purchase_order_form_inherit" model="ir.ui.view">
<field name="name">purchase.order.form.minimum.po.amount</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<field name="date_order" position="after">
<field name="minimum_po_amount" />
</field>
<xpath
expr="//button[@name='button_release_approval_block']"
position="attributes"
>
<attribute
name="attrs"
>{'invisible': ['|',('approval_block_id', '=', False),('state', 'not in', ['draft', 'sent', 'to approve'])]}</attribute>
</xpath>
</field>
</record>
<record id="view_purchase_order_filter_inherit" model="ir.ui.view">
<field name="name">request.quotation.minimum.block.reason</field>
<field name="model">purchase.order</field>
<field
name="inherit_id"
ref="purchase_order_approval_block.view_purchase_order_filter"
/>
<field name="arch" type="xml">
<filter name="blocked_po" position="attributes">
<attribute
name="domain"
>[('approval_block_id', '!=', False)]</attribute>
</filter>
</field>
</record>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2017 ForgeFlow S.L.
Copyright 2017 Serpent Consulting Services Pvt. Ltd.
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_partner_form_inherit" model="ir.ui.view">
<field name="name">res.partner.form.block.reason</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath
expr="//notebook/page[@name='sales_purchases']//group[@name='purchase']"
position="inside"
>
<field name="minimum_po_amount" />
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-purchase-workflow-purchase_minimum_amount"
version = "16.0.0"
description = "Purchase Minimum Amount - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-purchase-workflow-purchase_order_approval_block>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["purchase_minimum_amount"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]