From 6c5c28e13e8900142873d446d2b463369785562b Mon Sep 17 00:00:00 2001
From: Hector Meraz Chavez
Date: Fri, 10 Oct 2025 14:57:20 -0600
Subject: [PATCH 1/3] [ADD] purchase_auto_complete_no_zero: remove vendor bill
lines with zero quantity when filled from purchase order
---
purchase_auto_complete_no_zero/README.rst | 80 ++++
purchase_auto_complete_no_zero/__init__.py | 1 +
.../__manifest__.py | 13 +
.../models/__init__.py | 1 +
.../models/account_invoice.py | 18 +
purchase_auto_complete_no_zero/pyproject.toml | 3 +
.../readme/CONTRIBUTORS.md | 2 +
.../readme/DESCRIPTION.md | 1 +
.../static/description/index.html | 428 ++++++++++++++++++
9 files changed, 547 insertions(+)
create mode 100644 purchase_auto_complete_no_zero/README.rst
create mode 100644 purchase_auto_complete_no_zero/__init__.py
create mode 100644 purchase_auto_complete_no_zero/__manifest__.py
create mode 100644 purchase_auto_complete_no_zero/models/__init__.py
create mode 100644 purchase_auto_complete_no_zero/models/account_invoice.py
create mode 100644 purchase_auto_complete_no_zero/pyproject.toml
create mode 100644 purchase_auto_complete_no_zero/readme/CONTRIBUTORS.md
create mode 100644 purchase_auto_complete_no_zero/readme/DESCRIPTION.md
create mode 100644 purchase_auto_complete_no_zero/static/description/index.html
diff --git a/purchase_auto_complete_no_zero/README.rst b/purchase_auto_complete_no_zero/README.rst
new file mode 100644
index 00000000000..10a1bb0e5e9
--- /dev/null
+++ b/purchase_auto_complete_no_zero/README.rst
@@ -0,0 +1,80 @@
+==============================
+Purchase auto complete no zero
+==============================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:d2c2da7ca283711149cdd1042ae9907d038308cf1e9a1f8a209fff901ae0dc63
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |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-LGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
+ :alt: License: LGPL-3
+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
+ :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_auto_complete_no_zero
+ :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-17-0/purchase-workflow-17-0-purchase_auto_complete_no_zero
+ :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=17.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module ensures that, when creating a vendor bill from a Purchase
+Order, invoice lines are only generated for products that have a real,
+pending quantity to be invoiced.
+
+**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 to smash it by providing a detailed and welcomed
+`feedback `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+-------
+
+* Jarsa
+
+Contributors
+------------
+
+- `Jarsa `__:
+
+ - Hector Meraz
+
+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 `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/purchase_auto_complete_no_zero/__init__.py b/purchase_auto_complete_no_zero/__init__.py
new file mode 100644
index 00000000000..0650744f6bc
--- /dev/null
+++ b/purchase_auto_complete_no_zero/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/purchase_auto_complete_no_zero/__manifest__.py b/purchase_auto_complete_no_zero/__manifest__.py
new file mode 100644
index 00000000000..8739acca840
--- /dev/null
+++ b/purchase_auto_complete_no_zero/__manifest__.py
@@ -0,0 +1,13 @@
+# Copyright 2025 Jarsa
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+{
+ "name": "Purchase auto complete no zero",
+ "summary": "Avoid creating zero-quantity lines when creating a vendor bill.",
+ "version": "17.0.1.0.0",
+ "category": "Purchases",
+ "website": "https://github.com/OCA/purchase-workflow",
+ "author": "Jarsa, Odoo Community Association (OCA)",
+ "license": "LGPL-3",
+ "depends": ["purchase"],
+ "installable": True,
+}
diff --git a/purchase_auto_complete_no_zero/models/__init__.py b/purchase_auto_complete_no_zero/models/__init__.py
new file mode 100644
index 00000000000..8e072db8f3e
--- /dev/null
+++ b/purchase_auto_complete_no_zero/models/__init__.py
@@ -0,0 +1 @@
+from . import account_invoice
diff --git a/purchase_auto_complete_no_zero/models/account_invoice.py b/purchase_auto_complete_no_zero/models/account_invoice.py
new file mode 100644
index 00000000000..a2fc18537b1
--- /dev/null
+++ b/purchase_auto_complete_no_zero/models/account_invoice.py
@@ -0,0 +1,18 @@
+from odoo import api, models
+
+
+class AccountMove(models.Model):
+ _inherit = "account.move"
+
+ @api.onchange("purchase_vendor_bill_id", "purchase_id")
+ def _onchange_purchase_auto_complete(self):
+ res = super()._onchange_purchase_auto_complete()
+
+ lines_to_keep = self.invoice_line_ids.filtered(
+ lambda line: line.display_type in ("line_section", "line_note")
+ or (line.quantity > 0 and line.price_unit > 0)
+ )
+
+ self.invoice_line_ids = lines_to_keep
+
+ return res
diff --git a/purchase_auto_complete_no_zero/pyproject.toml b/purchase_auto_complete_no_zero/pyproject.toml
new file mode 100644
index 00000000000..4231d0cccb3
--- /dev/null
+++ b/purchase_auto_complete_no_zero/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/purchase_auto_complete_no_zero/readme/CONTRIBUTORS.md b/purchase_auto_complete_no_zero/readme/CONTRIBUTORS.md
new file mode 100644
index 00000000000..053acdd29b0
--- /dev/null
+++ b/purchase_auto_complete_no_zero/readme/CONTRIBUTORS.md
@@ -0,0 +1,2 @@
+- [Jarsa](https://www.jarsa.com):
+ - Hector Meraz
diff --git a/purchase_auto_complete_no_zero/readme/DESCRIPTION.md b/purchase_auto_complete_no_zero/readme/DESCRIPTION.md
new file mode 100644
index 00000000000..bd6daf1ccb1
--- /dev/null
+++ b/purchase_auto_complete_no_zero/readme/DESCRIPTION.md
@@ -0,0 +1 @@
+This module ensures that, when creating a vendor bill from a Purchase Order, invoice lines are only generated for products that have a real, pending quantity to be invoiced.
\ No newline at end of file
diff --git a/purchase_auto_complete_no_zero/static/description/index.html b/purchase_auto_complete_no_zero/static/description/index.html
new file mode 100644
index 00000000000..e3cc09efbd9
--- /dev/null
+++ b/purchase_auto_complete_no_zero/static/description/index.html
@@ -0,0 +1,428 @@
+
+
+
+
+
+Purchase auto complete no zero
+
+
+
+
+
Purchase auto complete no zero
+
+
+

+
This module ensures that, when creating a vendor bill from a Purchase
+Order, invoice lines are only generated for products that have a real,
+pending quantity to be invoiced.
+
Table of contents
+
+
+
+
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 to smash it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
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.
+
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 06ba4a6a76bbee9008ee30ccdaa3e9990a0def3b Mon Sep 17 00:00:00 2001
From: Hector Meraz Chavez
Date: Wed, 29 Apr 2026 16:54:24 -0600
Subject: [PATCH 2/3] [IMP] purchase_auto_complete_no_zero: pre-commit auto
fixes
---
purchase_auto_complete_no_zero/README.rst | 10 +++++-----
.../static/description/index.html | 6 +++---
purchase_supplierinfo_currency/README.rst | 2 +-
.../static/description/index.html | 11 +++++++----
4 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/purchase_auto_complete_no_zero/README.rst b/purchase_auto_complete_no_zero/README.rst
index 10a1bb0e5e9..d3837e0cf9f 100644
--- a/purchase_auto_complete_no_zero/README.rst
+++ b/purchase_auto_complete_no_zero/README.rst
@@ -17,13 +17,13 @@ Purchase auto complete no zero
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
- :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_auto_complete_no_zero
+ :target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_auto_complete_no_zero
: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-17-0/purchase-workflow-17-0-purchase_auto_complete_no_zero
+ :target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_auto_complete_no_zero
: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=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -43,7 +43,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 to smash 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_auto_complete_no_zero/static/description/index.html b/purchase_auto_complete_no_zero/static/description/index.html
index e3cc09efbd9..2e4728546eb 100644
--- a/purchase_auto_complete_no_zero/static/description/index.html
+++ b/purchase_auto_complete_no_zero/static/description/index.html
@@ -369,7 +369,7 @@ Purchase auto complete no zero
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d2c2da7ca283711149cdd1042ae9907d038308cf1e9a1f8a209fff901ae0dc63
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module ensures that, when creating a vendor bill from a Purchase
Order, invoice lines are only generated for products that have a real,
pending quantity to be invoiced.
@@ -390,7 +390,7 @@
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 to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -419,7 +419,7 @@
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_supplierinfo_currency/README.rst b/purchase_supplierinfo_currency/README.rst
index fd038ece519..baf8062b711 100644
--- a/purchase_supplierinfo_currency/README.rst
+++ b/purchase_supplierinfo_currency/README.rst
@@ -58,7 +58,7 @@ Authors
Contributors
------------
-- Alan Ramos
+- Alan Ramos
Maintainers
-----------
diff --git a/purchase_supplierinfo_currency/static/description/index.html b/purchase_supplierinfo_currency/static/description/index.html
index bd961f281c2..a656a810207 100644
--- a/purchase_supplierinfo_currency/static/description/index.html
+++ b/purchase_supplierinfo_currency/static/description/index.html
@@ -8,10 +8,11 @@
/*
:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
+: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.
@@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }
-pre.code .ln { color: grey; } /* line numbers */
+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 }
@@ -300,7 +301,7 @@
span.pre {
white-space: pre }
-span.problematic {
+span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -409,7 +410,9 @@
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.
From 0972f6f6d5df958d586cf9e3ae54dd0f5dd49db1 Mon Sep 17 00:00:00 2001
From: Hector Meraz Chavez
Date: Wed, 29 Apr 2026 16:54:25 -0600
Subject: [PATCH 3/3] [MIG] purchase_auto_complete_no_zero: Migration to 18.0
---
purchase_auto_complete_no_zero/__manifest__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/purchase_auto_complete_no_zero/__manifest__.py b/purchase_auto_complete_no_zero/__manifest__.py
index 8739acca840..b53427a7829 100644
--- a/purchase_auto_complete_no_zero/__manifest__.py
+++ b/purchase_auto_complete_no_zero/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Purchase auto complete no zero",
"summary": "Avoid creating zero-quantity lines when creating a vendor bill.",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"category": "Purchases",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Jarsa, Odoo Community Association (OCA)",