Initial commit: OCA Financial packages (186 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:04 +02:00
commit 3e0e8473fb
8757 changed files with 947473 additions and 0 deletions

View file

@ -0,0 +1,44 @@
# Account Fixed Discount
Odoo addon: account_invoice_fixed_discount
## Installation
```bash
pip install odoo-bringout-oca-account-invoicing-account_invoice_fixed_discount
```
## Dependencies
This addon depends on:
- account
## Manifest Information
- **Name**: Account Fixed Discount
- **Version**: 16.0.2.0.0
- **Category**: Accounting & Finance
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/account-invoicing](https://github.com/OCA/account-invoicing) branch 16.0, addon `account_invoice_fixed_discount`.
## 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
- 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,99 @@
======================
Account Fixed Discount
======================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9888c4df69bac53c42cd1ea2d99cdbd559258cf8fa888b0547e7fe0fcaa949d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_fixed_discount
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_fixed_discount
: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/account-invoicing&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends the functionality of Invoicing to allow you to apply fixed
amount discounts at invoice line level.
The module also extends the invoice report to show fixed discount.
**Table of contents**
.. contents::
:local:
Installation
============
**Warning**: This module is incompatible with
``account_invoice_triple_discount`` which also belongs to `OCA/account-invoicing
<https://github.com/OCA/account-invoicing>`__.
Usage
=====
To use this module, you need to:
#. Go to *Settings* and *Activate the developer mode*
#. Go to *Invoicing*.
#. Create a Invoice and specify a fixed discount in a line.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/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/account-invoicing/issues/new?body=module:%20account_invoice_fixed_discount%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
~~~~~~~~~~~~
* Lois Rilo <lois.rilo@forgeflow.com>
* Jordi Ballester <jordi.ballester@forgeflow.com>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
* Kitti U. <kittiu@ecosoft.co.th>
* Pieter Paulussen <pieterpaulussen@code-source.be>
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/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/account_invoice_fixed_discount>`_ 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)
from . import models

View file

@ -0,0 +1,21 @@
# Copyright 2017 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Account Fixed Discount",
"summary": "Allows to apply fixed amount discounts in invoices.",
"version": "16.0.2.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-invoicing",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["account"],
"excludes": ["account_invoice_triple_discount"],
"data": [
"security/res_groups.xml",
"views/account_move_view.xml",
"reports/report_account_invoice.xml",
],
}

View file

@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
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: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr ""

View file

@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
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: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr "<span class=\"text-nowrap\"> %)</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr "<span class=\"text-nowrap\"> (ili</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr "<span>Iznos popusta (%)</span>"
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Popust (fiksni)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr "Fiksni popust"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr "Stavka žurnala"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr "Porez"

View file

@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca\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: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr ""

View file

@ -0,0 +1,77 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-07-17 12:43+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n"
"Language-Team: none\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"
"X-Generator: Weblate 3.7.1\n"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Rabatt (abs.)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr ""
#~ msgid "<span>Disc. Fixed Amount</span>"
#~ msgstr "<span>Rabatt (abs.)</span>"
#~ msgid "Fixed amount discount."
#~ msgstr "Hier kann ein absoluter Rabatt hinzugefügt werden."
#, python-format
#~ msgid "You can only set one type of discount per line."
#~ msgstr ""
#~ "Es kann nur eine Art von Rabatt (prozentual oder absolut) pro Zeile "
#~ "gesetzt werden."
#~ msgid "Invoice"
#~ msgstr "Rechnung"
#~ msgid "Invoice Line"
#~ msgstr "Rechnungsposition"

View file

@ -0,0 +1,80 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-07 11:38+0000\n"
"Last-Translator: Anna Martínez <anna080678@gmail.com>\n"
"Language-Team: none\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: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr "<span class=\"text-nowrap\"> %)</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr "<span class=\"text-nowrap\"> (o</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr "<span>Importe del descuento (%)</span>"
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
"Aplica un descuento de importe fijo a esta línea. El importe se multiplica "
"por la cantidad del producto."
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Descuento (Fijo)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr "Descuento fijo"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr "Apuntes contables"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr "Impuesto"
#~ msgid "(or"
#~ msgstr "(o"
#~ msgid "<span>Disc. %</span>"
#~ msgstr "<span>Disc. %</span>"
#~ msgid "<span>Disc. Fixed Amount</span>"
#~ msgstr "<span>Cantidad Fija Descuento</span>"
#~ msgid "Fixed amount discount."
#~ msgstr "Cantidad fija de descuento."
#~ msgid "Journal Entries"
#~ msgstr "Asientos contables"
#, python-format
#~ msgid "You can only set one type of discount per line."
#~ msgstr "Solo puede establecer un tipo de descuento por línea."

View file

@ -0,0 +1,61 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-05-22 16:25+0000\n"
"Last-Translator: Vincent Hatakeyama <vincent+github@hatakeyama.fr>\n"
"Language-Team: none\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 5.10.4\n"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr "<span class=\"text-nowrap\">%)</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr "<span class=\"text-nowrap\"> (ou</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr "<span>Montant de la remise (%)</span>"
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
"Applique une remise dun montant fixe à cette ligne. Le montant est "
"multiplié par la quantité de produit."
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Remise (fixe)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr "Remise fixe"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr "Écriture comptable"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr "Taxe"

View file

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-04 12:37+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 4.17\n"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr "<span class=\"text-nowrap\"> %)</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr "<span class=\"text-nowrap\"> (o</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr "<span>Valore sconto (%)</span>"
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
"Applica un valore sconto a questa riga. Il valore è moltiplicato per la "
"quantità del prodotto."
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Sconto (fisso)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr "Sconto fisso"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr "Movimento contabile"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr "Imposta"
#~ msgid "(or"
#~ msgstr "(o"
#~ msgid "<span>Disc. %</span>"
#~ msgstr "<span>Sconto %</span>"

View file

@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_fixed_discount
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-22 02:49+0000\n"
"Last-Translator: Rodrigo Macedo <sottomaiormacedotec@users.noreply."
"translation.odoo-community.org>\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"
"X-Generator: Weblate 4.17\n"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> %)</span>"
msgstr "<span class=\"text-nowrap\"> %)</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span class=\"text-nowrap\"> (or</span>"
msgstr "<span class=\"text-nowrap\"> (or</span>"
#. module: account_invoice_fixed_discount
#: model_terms:ir.ui.view,arch_db:account_invoice_fixed_discount.report_invoice_document
msgid "<span>Discount Amount (%)</span>"
msgstr "<span>Total Desconto (%)</span>"
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,help:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid ""
"Apply a fixed amount discount to this line. The amount is multiplied by the "
"quantity of the product."
msgstr ""
"Aplique um desconto de valor fixo a esta linha. O valor é multiplicado pela "
"quantidade do produto."
#. module: account_invoice_fixed_discount
#: model:ir.model.fields,field_description:account_invoice_fixed_discount.field_account_move_line__discount_fixed
msgid "Discount (Fixed)"
msgstr "Desconto (Fixo)"
#. module: account_invoice_fixed_discount
#: model:res.groups,name:account_invoice_fixed_discount.group_fixed_discount
msgid "Fixed Discount"
msgstr "Desconto Fixo"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_move_line
msgid "Journal Item"
msgstr "Item Diário"
#. module: account_invoice_fixed_discount
#: model:ir.model,name:account_invoice_fixed_discount.model_account_tax
msgid "Tax"
msgstr "Imposto"
#~ msgid "(or"
#~ msgstr "(ou"
#~ msgid "<span>Disc. %</span>"
#~ msgstr "<span>Desc. %</span>"

View file

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

View file

@ -0,0 +1,89 @@
# Copyright 2017 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import api, fields, models
from odoo.tools.float_utils import float_is_zero
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
discount_fixed = fields.Monetary(
string="Discount (Fixed)",
default=0.0,
currency_field="currency_id",
help=(
"Apply a fixed amount discount to this line. The amount is multiplied by "
"the quantity of the product."
),
)
@api.depends("quantity", "discount", "price_unit", "tax_ids", "currency_id")
def _compute_totals(self):
"""Adjust the computation of the price_subtotal and price_total fields to
account for the fixed discount amount.
By using the unrounded calculated discount value, we avoid rounding errors
in the resulting calculated totals.
We only need to do this for lines with a fixed discount.
"""
done_lines = self.env["account.move.line"]
for line in self:
if float_is_zero(
line.discount_fixed, precision_rounding=line.currency_id.rounding
):
continue
# Pass the actual float value of the discount to the tax computation method.
discount = line._get_discount_from_fixed_discount()
line_discount_price_unit = line.price_unit * (1 - (discount / 100.0))
if line.tax_ids:
taxes_res = line.tax_ids.compute_all(
line_discount_price_unit,
quantity=line.quantity,
currency=line.currency_id,
product=line.product_id,
partner=line.partner_id,
is_refund=line.is_refund,
)
line.price_subtotal = taxes_res["total_excluded"]
line.price_total = taxes_res["total_included"]
else:
# No taxes applied on the line.
subtotal = line.quantity * line_discount_price_unit
line.price_total = line.price_subtotal = subtotal
done_lines |= line
# Compute the regular totals for regular lines.
return super(AccountMoveLine, self - done_lines)._compute_totals()
@api.onchange("discount_fixed")
def _onchange_discount_fixed(self):
"""Compute the fixed discount based on the discount percentage."""
if self.env.context.get("ignore_discount_onchange"):
return
self.env.context = self.with_context(ignore_discount_onchange=True).env.context
self.discount = self._get_discount_from_fixed_discount()
@api.onchange("discount")
def _onchange_discount(self):
"""Compute the discount percentage based on the fixed discount.
Ignore the onchange if the fixed discount is already set.
"""
if self.env.context.get("ignore_discount_onchange"):
return
self.env.context = self.with_context(ignore_discount_onchange=True).env.context
self.discount_fixed = 0.0
def _get_discount_from_fixed_discount(self):
"""Calculate the discount percentage from the fixed discount amount."""
self.ensure_one()
currency = self.currency_id or self.company_id.currency_id
if float_is_zero(self.discount_fixed, precision_rounding=currency.rounding):
return 0.0
return (
(self.price_unit != 0)
and ((self.discount_fixed) / self.price_unit) * 100
or 0.00
)

View file

@ -0,0 +1,53 @@
# Copyright 2017 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import api, models
class AccountTax(models.Model):
_inherit = "account.tax"
@api.model
def _convert_to_tax_base_line_dict(
self,
base_line,
partner=None,
currency=None,
product=None,
taxes=None,
price_unit=None,
quantity=None,
discount=None,
account=None,
analytic_distribution=None,
price_subtotal=None,
is_refund=False,
rate=None,
handle_price_include=True,
extra_context=None,
):
"""Insert the un-rounded discount value in the resulting tax computation values."""
res = super()._convert_to_tax_base_line_dict(
base_line,
partner=partner,
currency=currency,
product=product,
taxes=taxes,
price_unit=price_unit,
quantity=quantity,
discount=discount,
account=account,
analytic_distribution=analytic_distribution,
price_subtotal=price_subtotal,
is_refund=is_refund,
rate=rate,
handle_price_include=handle_price_include,
extra_context=extra_context,
)
if (
base_line
and base_line._name == "account.move.line"
and base_line.discount_fixed
):
res["discount"] = base_line._get_discount_from_fixed_discount()
return res

View file

@ -0,0 +1,5 @@
* Lois Rilo <lois.rilo@forgeflow.com>
* Jordi Ballester <jordi.ballester@forgeflow.com>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
* Kitti U. <kittiu@ecosoft.co.th>
* Pieter Paulussen <pieterpaulussen@code-source.be>

View file

@ -0,0 +1,4 @@
This module extends the functionality of Invoicing to allow you to apply fixed
amount discounts at invoice line level.
The module also extends the invoice report to show fixed discount.

View file

@ -0,0 +1,3 @@
**Warning**: This module is incompatible with
``account_invoice_triple_discount`` which also belongs to `OCA/account-invoicing
<https://github.com/OCA/account-invoicing>`__.

View file

@ -0,0 +1,5 @@
To use this module, you need to:
#. Go to *Settings* and *Activate the developer mode*
#. Go to *Invoicing*.
#. Create a Invoice and specify a fixed discount in a line.

View file

@ -0,0 +1,32 @@
<!-- Copyright 2017 ForgeFlow S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//t[@t-set='display_discount']" position="after">
<t
t-set="display_discount_fixed"
t-value="any([l.discount_fixed for l in o.invoice_line_ids])"
/>
</xpath>
<xpath expr="//th[@t-if='display_discount']/span" position="attributes">
<attribute name="t-if">not display_discount_fixed</attribute>
</xpath>
<xpath expr="//th[@t-if='display_discount']/span" position="before">
<t t-if="display_discount_fixed">
<span>Discount Amount (%)</span>
</t>
</xpath>
<span t-field="line.discount" position="before">
<t t-if="display_discount_fixed">
<span class="text-nowrap" t-field="line.discount_fixed" /><span
class="text-nowrap"
> (or</span>
</t>
</span>
<span t-field="line.discount" position="after">
<t t-if="display_discount_fixed"><span class="text-nowrap"> %)</span></t>
</span>
</template>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="group_fixed_discount" model="res.groups">
<field name="name">Fixed Discount</field>
</record>
</data>
<data noupdate="1">
<record id="account.group_account_invoice" model="res.groups">
<field
name="implied_ids"
eval="[(4, ref('account_invoice_fixed_discount.group_fixed_discount'))]"
/>
</record>
</data>
</odoo>

View file

@ -0,0 +1,445 @@
<!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>Account Fixed Discount</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="account-fixed-discount">
<h1 class="title">Account Fixed Discount</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9888c4df69bac53c42cd1ea2d99cdbd559258cf8fa888b0547e7fe0fcaa949d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/account-invoicing/tree/16.0/account_invoice_fixed_discount"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_invoice_fixed_discount"><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/account-invoicing&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 extends the functionality of Invoicing to allow you to apply fixed
amount discounts at invoice line level.</p>
<p>The module also extends the invoice report to show fixed discount.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p><strong>Warning</strong>: This module is incompatible with
<tt class="docutils literal">account_invoice_triple_discount</tt> which also belongs to <a class="reference external" href="https://github.com/OCA/account-invoicing">OCA/account-invoicing</a>.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <em>Settings</em> and <em>Activate the developer mode</em></li>
<li>Go to <em>Invoicing</em>.</li>
<li>Create a Invoice and specify a fixed discount in a line.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/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/account-invoicing/issues/new?body=module:%20account_invoice_fixed_discount%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-4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
<li>Rattapong Chokmasermkul &lt;<a class="reference external" href="mailto:rattapongc&#64;ecosoft.co.th">rattapongc&#64;ecosoft.co.th</a>&gt;</li>
<li>Kitti U. &lt;<a class="reference external" href="mailto:kittiu&#64;ecosoft.co.th">kittiu&#64;ecosoft.co.th</a>&gt;</li>
<li>Pieter Paulussen &lt;<a class="reference external" href="mailto:pieterpaulussen&#64;code-source.be">pieterpaulussen&#64;code-source.be</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">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/account-invoicing/tree/16.0/account_invoice_fixed_discount">OCA/account-invoicing</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)
from . import test_account_fixed_discount

View file

@ -0,0 +1,147 @@
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo.tests import TransactionCase
from odoo.tests.common import Form
class TestInvoiceFixedDiscount(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestInvoiceFixedDiscount, cls).setUpClass()
cls.env.user.groups_id |= cls.env.ref("account.group_account_invoice")
cls.partner = cls.env["res.partner"].create({"name": "Test"})
cls.product = cls.env.ref("product.product_product_3")
cls.account = cls.env["account.account"].search(
[("account_type", "=", "income")],
limit=1,
)
cls.output_vat_acct = cls.env["account.account"].create(
{"name": "10", "code": "10", "account_type": "liability_current"}
)
cls.tax_group_vat = cls.env["account.tax.group"].create({"name": "VAT"})
cls.vat = cls.env["account.tax"].create(
{
"name": "TEST 10%",
"type_tax_use": "sale",
"amount_type": "percent",
"amount": 10.00,
"tax_group_id": cls.tax_group_vat.id,
"tax_exigibility": "on_invoice",
"invoice_repartition_line_ids": [
(0, 0, {"factor_percent": 100.0, "repartition_type": "base"}),
(
0,
0,
{
"factor_percent": 100.0,
"repartition_type": "tax",
"account_id": cls.output_vat_acct.id,
},
),
],
}
)
cls.invoice = cls._create_invoice()
@classmethod
def _create_invoice(cls, discount=0.00, discount_fixed=0.00):
invoice_vals = [
(
0,
0,
{
"product_id": cls.product.id,
"quantity": 1.0,
"account_id": cls.account.id,
"name": "Line 1",
"price_unit": 200.00,
"discount_fixed": discount_fixed,
"discount": discount,
"tax_ids": [(6, 0, [cls.vat.id])],
},
)
]
invoice = (
cls.env["account.move"]
.with_context(check_move_validity=False)
.create(
{
"journal_id": cls.env["account.journal"]
.search([("type", "=", "sale")], limit=1)
.id,
"partner_id": cls.partner.id,
"move_type": "out_invoice",
"invoice_line_ids": invoice_vals,
}
)
)
return invoice
def test_01_discounts_fixed_single_unit(self):
"""Tests multiple discounts in line with taxes."""
# Fixed discount 1.0 unit at 57.00
with Form(self.invoice) as invoice_form:
with invoice_form.invoice_line_ids.edit(0) as line:
line.discount_fixed = 57.00
# compute discount (57 / 200) * 100
self.assertEqual(self.invoice.invoice_line_ids.discount, 28.5)
# compute amount total (200 - 57) * 10%
self.assertEqual(self.invoice.amount_total, 157.3)
self.assertEqual(self.invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(self.invoice.invoice_line_ids.price_subtotal, 143.00)
# Reset to regular discount at 20.00%
with Form(self.invoice) as invoice_form:
with invoice_form.invoice_line_ids.edit(0) as line:
# Force the fixed discount as the onchange does not
# handle the context properly
line.discount_fixed = 0.0
line.discount = 20.0
self.assertEqual(self.invoice.invoice_line_ids.discount_fixed, 0.0)
self.assertEqual(self.invoice.invoice_line_ids.discount, 20.0)
self.assertEqual(self.invoice.amount_total, 176.0)
self.assertEqual(self.invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(self.invoice.invoice_line_ids.price_subtotal, 160.00)
def test_02_discounts_fixed_multiple_units(self):
"""Tests multiple discounts in line with taxes."""
# Fixed discount 2.0 units at 50.00
with Form(self.invoice) as invoice_form:
with invoice_form.invoice_line_ids.edit(0) as line:
line.discount_fixed = 25.00
line.quantity = 2.0
# compute discount ((50 / 2) / 200) * 100
self.assertEqual(self.invoice.invoice_line_ids.discount, 12.5)
self.assertEqual(self.invoice.amount_total, 385.0)
self.assertEqual(self.invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(self.invoice.invoice_line_ids.price_subtotal, 350)
def test_03_discount_fixed_no_tax(self):
"""Tests fixed discount with no taxes."""
# Fixed discount 1.0 unit at 57.00
with Form(self.invoice) as invoice_form:
with invoice_form.invoice_line_ids.edit(0) as line:
line.tax_ids.clear()
line.discount_fixed = 57.00
# compute discount (57 / 200) * 100
self.assertEqual(self.invoice.invoice_line_ids.discount, 28.5)
self.assertEqual(self.invoice.amount_total, 143)
self.assertEqual(self.invoice.invoice_line_ids.price_unit, 200.00)
self.assertEqual(self.invoice.invoice_line_ids.price_subtotal, 143)
def test_04_base_line_set_to_none(self):
self.vat._convert_to_tax_base_line_dict(
None,
price_unit=10,
currency=1,
)

View file

@ -0,0 +1,30 @@
<!-- Copyright 2017 ForgeFlow S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="name">account.move.form - fixed_discount</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='invoice_line_ids']/tree/field[@name='discount']"
position="before"
>
<field
name="discount_fixed"
groups="account_invoice_fixed_discount.group_fixed_discount"
optional="show"
/>
</xpath>
<xpath
expr="//field[@name='invoice_line_ids']/form/sheet/group/field[@name='discount']"
position="before"
>
<field
name="discount_fixed"
groups="account_invoice_fixed_discount.group_fixed_discount"
/>
</xpath>
</field>
</record>
</odoo>

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 Account_invoice_fixed_discount Module - account_invoice_fixed_discount
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 account_invoice_fixed_discount. 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:
- [account](../../odoo-bringout-oca-ocb-account)

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 account_invoice_fixed_discount or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-account-invoicing-account_invoice_fixed_discount"
# or
uv pip install odoo-bringout-oca-account-invoicing-account_invoice_fixed_discount"
```

View file

@ -0,0 +1,13 @@
# Models
Detected core models and extensions in account_invoice_fixed_discount.
```mermaid
classDiagram
class account_move_line
class account_tax
```
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: account_invoice_fixed_discount. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon account_invoice_fixed_discount
- License: LGPL-3

View file

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

View file

@ -0,0 +1,62 @@
# Security
Access control and security definitions in account_invoice_fixed_discount.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[CHANGELOG.md](../CHANGELOG.md)**
- 132 model access rules
- **[doc](../doc)**
- **[docker](../docker)**
- **[input](../input)**
- **[nix](../nix)**
- **[odoo.conf](../odoo.conf)**
- 58 model access rules
- **[odoo_packages_bez_l10n.txt](../odoo_packages_bez_l10n.txt)**
- 1947 model access rules
- **[odoo_packages_bringout.txt](../odoo_packages_bringout.txt)**
- 1947 model access rules
- **[odoo_packages.txt](../odoo_packages.txt)**
- 2085 model access rules
- **[output](../output)**
- **[packages](../packages)**
- **[PACKAGES.md](../PACKAGES.md)**
- 298 model access rules
- **[README.md](../README.md)**
- 338 model access rules
- **[scripts](../scripts)**
- **[temp](../temp)**
- **[TRANSLATION_BS_SUMMARY.md](../TRANSLATION_BS_SUMMARY.md)**
- 146 model access rules
## Record Rules
Row-level security rules defined in:
## Security Groups & Configuration
Security groups and permissions defined in:
- **[res_groups.xml](../account_invoice_fixed_discount/security/res_groups.xml)**
- 2 security groups defined
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[res_groups.xml](../account_invoice_fixed_discount/security/res_groups.xml)**
- Security groups, categories, and XML-based rules
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

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 account_invoice_fixed_discount
```

View file

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

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-account-invoicing-account_invoice_fixed_discount"
version = "16.0.0"
description = "Account Fixed Discount - Allows to apply fixed amount discounts in invoices."
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-account>=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 = ["account_invoice_fixed_discount"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]