Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions purchase_force_invoiced_quantity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.. 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/19.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-19-0/purchase-workflow-19-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=19.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 <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.

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 <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_force_invoiced_quantity%0Aversion:%2019.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
-------

* Cetmix

Contributors
------------

- `Cetmix <http://cetmix.com>`__

..

- Ivan Sokolov
- Dessan Hemrayev

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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/19.0/purchase_force_invoiced_quantity>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions purchase_force_invoiced_quantity/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions purchase_force_invoiced_quantity/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "19.0.1.0.0",
"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,
}
14 changes: 14 additions & 0 deletions purchase_force_invoiced_quantity/demo/demo_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="demo_product_purchase_force_invoiced_qty_1" model="product.product">
<field name="name">Purchase Force Invoiced qty product 1</field>
<field name="type">service</field>
<field name="purchase_method">receive</field>
</record>

<record id="demo_product_purchase_force_invoiced_qty_2" model="product.product">
<field name="name">Purchase Force Invoiced qty product 2</field>
<field name="type">service</field>
<field name="purchase_method">receive</field>
</record>
</odoo>
23 changes: 23 additions & 0 deletions purchase_force_invoiced_quantity/demo/demo_purchase_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="so_purchase_force_invoiced_qty_1" model="purchase.order">
<field name="partner_id" ref="base.partner_admin" />
<field name="user_id" ref="base.user_admin" />
</record>

<record id="sol_purchase_force_invoiced_qty_1_1" model="purchase.order.line">
<field name="order_id" ref="so_purchase_force_invoiced_qty_1" />
<field name="product_id" ref="demo_product_purchase_force_invoiced_qty_1" />
<field name="product_uom_qty">5</field>
<field name="force_invoiced_qty">3</field>
<field name="price_unit">295.00</field>
</record>

<record id="sol_purchase_force_invoiced_qty_1_2" model="purchase.order.line">
<field name="order_id" ref="so_purchase_force_invoiced_qty_1" />
<field name="product_id" ref="demo_product_purchase_force_invoiced_qty_2" />
<field name="product_uom_qty">5</field>
<field name="force_invoiced_qty">0</field>
<field name="price_unit">145.00</field>
</record>
</odoo>
56 changes: 56 additions & 0 deletions purchase_force_invoiced_quantity/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 <stefano.consolaro@mymage.it>\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"
42 changes: 42 additions & 0 deletions purchase_force_invoiced_quantity/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -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 ""
Original file line number Diff line number Diff line change
@@ -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 ""
4 changes: 4 additions & 0 deletions purchase_force_invoiced_quantity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions purchase_force_invoiced_quantity/models/purchase_order_line.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions purchase_force_invoiced_quantity/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions purchase_force_invoiced_quantity/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No configuration is required.
10 changes: 10 additions & 0 deletions purchase_force_invoiced_quantity/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions purchase_force_invoiced_quantity/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [Cetmix](http://cetmix.com)

> - Ivan Sokolov
> - Dessan Hemrayev

- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
Loading
Loading