diff --git a/purchase_force_invoiced_quantity/README.rst b/purchase_force_invoiced_quantity/README.rst new file mode 100644 index 0000000..c6407d3 --- /dev/null +++ b/purchase_force_invoiced_quantity/README.rst @@ -0,0 +1,119 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Purchase Force Invoiced Quantity +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d2654ecfc75bc0715ae3625b649842faaca507543fec3cec094ffbe3422ec310 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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/18.0/purchase_force_invoiced_quantity + :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-18-0/purchase-workflow-18-0-purchase_force_invoiced_quantity + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module add a new "Force Invoiced" field to purchase order lines. +This field is used as modifier when computing quantity to be invoiced. + +Current behaviour: quantity to invoice = delivered - invoiced + +Implemented behaviour: quantity to invoice = delivered - invoiced - +force invoiced + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +This module implements additional featured for the `Purchase Force +Invoiced `__ +module. + +It covers the following scenarios: + +- One need to modify the quantity to be invoiced after the products were + received. Eg .you negotiated an extra discount from your vendor. +- You would like to fix some issues with quantities invoiced cause by + incorrect data entry. + +Configuration +============= + +No configuration is required. + +Usage +===== + +Open a purchase order and add an amount into the "Force Invoiced" field. +Amount to invoice will be adjusted accordingly. This field is optional +so you can hide it if you don't need it. + +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 +------- + +* Cetmix + +Contributors +------------ + +- `Cetmix `__ + +.. + + - Ivan Sokolov + - Dessan Hemrayev + +- Heliconia Solutions Pvt. Ltd. + +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_force_invoiced_quantity/__init__.py b/purchase_force_invoiced_quantity/__init__.py new file mode 100644 index 0000000..bf8e144 --- /dev/null +++ b/purchase_force_invoiced_quantity/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/purchase_force_invoiced_quantity/__manifest__.py b/purchase_force_invoiced_quantity/__manifest__.py new file mode 100644 index 0000000..86385c9 --- /dev/null +++ b/purchase_force_invoiced_quantity/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Purchase Force Invoiced Quantity", + "summary": "Add manual invoice quantity in purchase order lines", + "version": "18.0.1.1.1", + "author": "Cetmix, Odoo Community Association (OCA)", + "category": "Purchase Management", + "license": "AGPL-3", + "website": "https://github.com/OCA/purchase-workflow", + "depends": ["purchase_force_invoiced"], + "data": [ + "views/purchase_order.xml", + ], + "demo": [ + "demo/demo_product.xml", + "demo/demo_purchase_order.xml", + ], + "installable": True, +} diff --git a/purchase_force_invoiced_quantity/demo/demo_product.xml b/purchase_force_invoiced_quantity/demo/demo_product.xml new file mode 100644 index 0000000..67512fd --- /dev/null +++ b/purchase_force_invoiced_quantity/demo/demo_product.xml @@ -0,0 +1,14 @@ + + + + Purchase Force Invoiced qty product 1 + service + receive + + + + Purchase Force Invoiced qty product 2 + service + receive + + diff --git a/purchase_force_invoiced_quantity/demo/demo_purchase_order.xml b/purchase_force_invoiced_quantity/demo/demo_purchase_order.xml new file mode 100644 index 0000000..85e5241 --- /dev/null +++ b/purchase_force_invoiced_quantity/demo/demo_purchase_order.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + 5 + 3 + 295.00 + + + + + + 5 + 0 + 145.00 + + diff --git a/purchase_force_invoiced_quantity/i18n/it.po b/purchase_force_invoiced_quantity/i18n/it.po new file mode 100644 index 0000000..ade4cd2 --- /dev/null +++ b/purchase_force_invoiced_quantity/i18n/it.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_force_invoiced_quantity +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-09-16 10:20+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\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 5.10.4\n" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model.fields,field_description:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "Force Invoiced Qty" +msgstr "Forza q.tà fatturata" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_1_product_template +msgid "Purchase Force Invoiced qty product 1" +msgstr "Quantità fatturazione formzata acquisto prodotto 1" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_2_product_template +msgid "Purchase Force Invoiced qty product 2" +msgstr "Quantità fatturazione formzata acquisto prodotto 2" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model,name:purchase_force_invoiced_quantity.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "Riga ordine di acquisto" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model.fields,help:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "" +"This amount will be deducted from quantity to invoice.\n" +"quantity to invoice = delivered - invoiced - force invoiced qty" +msgstr "" +"Questo valore verrà dedotto dalla quantità da fatturare.\n" +"quantità da fatturare = consegnata - fatturata - forzata a fatturata" + +#~ msgid "Force Invoiced" +#~ msgstr "Forza a fatturato" + +#~ msgid "" +#~ "This amount will be deducted from quantity to invoice.\n" +#~ "quantity to invoice = delivered - invoiced - force invoiced" +#~ msgstr "" +#~ "Questo valore verrà dedotto dalla quantità da fatturare.\n" +#~ "quantità da fatturare = consegnata - fatturata - forzata a fatturata" diff --git a/purchase_force_invoiced_quantity/i18n/pt_BR.po b/purchase_force_invoiced_quantity/i18n/pt_BR.po new file mode 100644 index 0000000..f41dff3 --- /dev/null +++ b/purchase_force_invoiced_quantity/i18n/pt_BR.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_force_invoiced_quantity +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\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" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model.fields,field_description:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "Force Invoiced Qty" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_1_product_template +msgid "Purchase Force Invoiced qty product 1" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_2_product_template +msgid "Purchase Force Invoiced qty product 2" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model,name:purchase_force_invoiced_quantity.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model.fields,help:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "" +"This amount will be deducted from quantity to invoice.\n" +"quantity to invoice = delivered - invoiced - force invoiced qty" +msgstr "" diff --git a/purchase_force_invoiced_quantity/i18n/purchase_force_invoiced_quantity.pot b/purchase_force_invoiced_quantity/i18n/purchase_force_invoiced_quantity.pot new file mode 100644 index 0000000..133a23c --- /dev/null +++ b/purchase_force_invoiced_quantity/i18n/purchase_force_invoiced_quantity.pot @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_force_invoiced_quantity +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_force_invoiced_quantity +#: model:ir.model.fields,field_description:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "Force Invoiced Qty" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_1_product_template +msgid "Purchase Force Invoiced qty product 1" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:product.template,name:purchase_force_invoiced_quantity.demo_product_purchase_force_invoiced_qty_2_product_template +msgid "Purchase Force Invoiced qty product 2" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model,name:purchase_force_invoiced_quantity.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: purchase_force_invoiced_quantity +#: model:ir.model.fields,help:purchase_force_invoiced_quantity.field_purchase_order_line__force_invoiced_qty +msgid "" +"This amount will be deducted from quantity to invoice.\n" +"quantity to invoice = delivered - invoiced - force invoiced qty" +msgstr "" diff --git a/purchase_force_invoiced_quantity/migrations/18.0.1.1.0/pre-migration.py b/purchase_force_invoiced_quantity/migrations/18.0.1.1.0/pre-migration.py new file mode 100644 index 0000000..1588283 --- /dev/null +++ b/purchase_force_invoiced_quantity/migrations/18.0.1.1.0/pre-migration.py @@ -0,0 +1,30 @@ +# Copyright 2025 ForgeFlow +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo.tools.sql import column_exists + +_logger = logging.getLogger(__name__) + + +def migrate_force_invoiced_to_force_invoiced_qty(cr): + old_field_exists = column_exists(cr, "purchase_order_line", "force_invoiced") + new_field_exists = column_exists(cr, "purchase_order_line", "force_invoiced_qty") + if old_field_exists and not new_field_exists: + _logger.info( + "Renaming force_invoiced field to force_invoiced_qty in purchase_order_line" + ) + cr.execute( + "ALTER TABLE purchase_order_line " + "RENAME COLUMN force_invoiced TO force_invoiced_qty" + ) + _logger.info("Successfully renamed force_invoiced to force_invoiced_qty") + if new_field_exists: + _logger.info("Field force_invoiced_qty already exists, skipping migration") + if not old_field_exists: + _logger.info("Field force_invoiced does not exist, skipping migration") + + +def migrate(cr, version): + migrate_force_invoiced_to_force_invoiced_qty(cr) diff --git a/purchase_force_invoiced_quantity/models/__init__.py b/purchase_force_invoiced_quantity/models/__init__.py new file mode 100644 index 0000000..a8311a3 --- /dev/null +++ b/purchase_force_invoiced_quantity/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import purchase_order_line diff --git a/purchase_force_invoiced_quantity/models/purchase_order_line.py b/purchase_force_invoiced_quantity/models/purchase_order_line.py new file mode 100644 index 0000000..b1ae9b8 --- /dev/null +++ b/purchase_force_invoiced_quantity/models/purchase_order_line.py @@ -0,0 +1,33 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class PurchaseOrderLine(models.Model): + _inherit = "purchase.order.line" + + force_invoiced_qty = fields.Float( + digits="Product Unit of Measure", + help=( + "This amount will be deducted from quantity to invoice." + "\nquantity to invoice = delivered - invoiced - force invoiced qty" + ), + ) + + @api.depends("force_invoiced_qty") + def _compute_qty_invoiced(self): + """ + Compute the quantity to invoice. + """ + res = super()._compute_qty_invoiced() + for line in self.filtered(lambda line: line.force_invoiced_qty): + # compute qty_to_invoice + if ( + line.order_id.state in ["purchase", "done"] + and line.product_id.purchase_method != "purchase" + ): + line.qty_to_invoice = ( + line.qty_received - line.qty_invoiced - line.force_invoiced_qty + ) + return res diff --git a/purchase_force_invoiced_quantity/pyproject.toml b/purchase_force_invoiced_quantity/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/purchase_force_invoiced_quantity/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/purchase_force_invoiced_quantity/readme/CONFIGURE.md b/purchase_force_invoiced_quantity/readme/CONFIGURE.md new file mode 100644 index 0000000..718c4a6 --- /dev/null +++ b/purchase_force_invoiced_quantity/readme/CONFIGURE.md @@ -0,0 +1 @@ +No configuration is required. diff --git a/purchase_force_invoiced_quantity/readme/CONTEXT.md b/purchase_force_invoiced_quantity/readme/CONTEXT.md new file mode 100644 index 0000000..df07350 --- /dev/null +++ b/purchase_force_invoiced_quantity/readme/CONTEXT.md @@ -0,0 +1,10 @@ +This module implements additional featured for the [Purchase Force +Invoiced](https://github.com/OCA/purchase-workflow/tree/16.0/purchase_force_invoiced) +module. + +It covers the following scenarios: + +- One need to modify the quantity to be invoiced after the products were + received. Eg .you negotiated an extra discount from your vendor. +- You would like to fix some issues with quantities invoiced cause by + incorrect data entry. diff --git a/purchase_force_invoiced_quantity/readme/CONTRIBUTORS.md b/purchase_force_invoiced_quantity/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..2b5e38b --- /dev/null +++ b/purchase_force_invoiced_quantity/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- [Cetmix](http://cetmix.com) + +> - Ivan Sokolov +> - Dessan Hemrayev + +- Heliconia Solutions Pvt. Ltd. \<\> diff --git a/purchase_force_invoiced_quantity/readme/DESCRIPTION.md b/purchase_force_invoiced_quantity/readme/DESCRIPTION.md new file mode 100644 index 0000000..91ca741 --- /dev/null +++ b/purchase_force_invoiced_quantity/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module add a new "Force Invoiced" field to purchase order lines. +This field is used as modifier when computing quantity to be invoiced. + +Current behaviour: quantity to invoice = delivered - invoiced + +Implemented behaviour: quantity to invoice = delivered - invoiced - +force invoiced diff --git a/purchase_force_invoiced_quantity/readme/USAGE.md b/purchase_force_invoiced_quantity/readme/USAGE.md new file mode 100644 index 0000000..04c404e --- /dev/null +++ b/purchase_force_invoiced_quantity/readme/USAGE.md @@ -0,0 +1,3 @@ +Open a purchase order and add an amount into the "Force Invoiced" field. +Amount to invoice will be adjusted accordingly. This field is optional +so you can hide it if you don't need it. diff --git a/purchase_force_invoiced_quantity/static/description/icon.png b/purchase_force_invoiced_quantity/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/purchase_force_invoiced_quantity/static/description/icon.png differ diff --git a/purchase_force_invoiced_quantity/static/description/index.html b/purchase_force_invoiced_quantity/static/description/index.html new file mode 100644 index 0000000..76433dc --- /dev/null +++ b/purchase_force_invoiced_quantity/static/description/index.html @@ -0,0 +1,469 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Purchase Force Invoiced Quantity

+ +

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

+

This module add a new “Force Invoiced” field to purchase order lines. +This field is used as modifier when computing quantity to be invoiced.

+

Current behaviour: quantity to invoice = delivered - invoiced

+

Implemented behaviour: quantity to invoice = delivered - invoiced - +force invoiced

+

Table of contents

+ +
+

Use Cases / Context

+

This module implements additional featured for the Purchase Force +Invoiced +module.

+

It covers the following scenarios:

+
    +
  • One need to modify the quantity to be invoiced after the products were +received. Eg .you negotiated an extra discount from your vendor.
  • +
  • You would like to fix some issues with quantities invoiced cause by +incorrect data entry.
  • +
+
+
+

Configuration

+

No configuration is required.

+
+
+

Usage

+

Open a purchase order and add an amount into the “Force Invoiced” field. +Amount to invoice will be adjusted accordingly. This field is optional +so you can hide it if you don’t need it.

+
+
+

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

+
    +
  • Cetmix
  • +
+
+
+

Contributors

+ + +
+
    +
  • Ivan Sokolov
  • +
  • Dessan Hemrayev
  • +
+
+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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

+

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

+

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

+
+
+
+
+ + diff --git a/purchase_force_invoiced_quantity/tests/__init__.py b/purchase_force_invoiced_quantity/tests/__init__.py new file mode 100644 index 0000000..0f68af5 --- /dev/null +++ b/purchase_force_invoiced_quantity/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_purchase_force_invoiced_quantity diff --git a/purchase_force_invoiced_quantity/tests/test_purchase_force_invoiced_quantity.py b/purchase_force_invoiced_quantity/tests/test_purchase_force_invoiced_quantity.py new file mode 100644 index 0000000..404bd3d --- /dev/null +++ b/purchase_force_invoiced_quantity/tests/test_purchase_force_invoiced_quantity.py @@ -0,0 +1,63 @@ +# Copyright (C) 2024 Cetmix OÜ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestPurchaseForceInvoicedQTY(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + + cls.purchase_order_obj = cls.env["purchase.order"] + cls.purchase_order_line_obj = cls.env["purchase.order.line"] + + cls.customer = cls._create_customer("test_customer") + cls.product_1 = cls._create_product("test_product_1") + cls.product_2 = cls._create_product("test_product_2") + + @classmethod + def _create_customer(cls, name): + """Create a Partner.""" + return cls.env["res.partner"].create( + {"name": name, "email": "example@yourcompany.com"} + ) + + @classmethod + def _create_product(cls, name): + return cls.env["product.product"].create( + { + "name": name, + "type": "service", + "purchase_method": "receive", + } + ) + + def test_purchase_order(self): + po = self.purchase_order_obj.create({"partner_id": self.customer.id}) + pol1 = self.purchase_order_line_obj.create( + {"product_id": self.product_1.id, "product_uom_qty": 3, "order_id": po.id} + ) + pol2 = self.purchase_order_line_obj.create( + {"product_id": self.product_2.id, "product_uom_qty": 2, "order_id": po.id} + ) + + # confirm quotation + po.button_confirm() + # update quantities delivered + pol1.qty_received = 1 + pol2.qty_received = 2 + + pol2.force_invoiced_qty = 3 + self.assertEqual( + pol2.qty_to_invoice, -1, msg="The quantity to invoice should be -1" + ) + self.assertEqual( + po.invoice_status, "to invoice", "The invoice status should be To Invoice" + ) + + po.action_create_invoice() + self.assertEqual( + po.invoice_status, "invoiced", "The invoice status should be Invoiced" + ) diff --git a/purchase_force_invoiced_quantity/views/purchase_order.xml b/purchase_force_invoiced_quantity/views/purchase_order.xml new file mode 100644 index 0000000..f613dd3 --- /dev/null +++ b/purchase_force_invoiced_quantity/views/purchase_order.xml @@ -0,0 +1,22 @@ + + + + purchase.order.form + purchase.order + + + + + + + + +