Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] sale_order_invoicing_qty_percentage: Migration to version 15.0 #1416

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 106 additions & 0 deletions sale_order_invoicing_qty_percentage/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
===================================================
Sales order invoicing by percentage of the quantity
===================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/13.0/sale_order_invoicing_qty_percentage
: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-13-0/account-invoicing-13-0-sale_order_invoicing_qty_percentage
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/95/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to invoice a percentage of the sales order, modifying
invoiced quantities according such percentage.

Example: You have a service line to invoice 10 hours. You choose to invoice
a 50% of the quantity, so the generated invoice line has 5 hours.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Go to *Sales > Invoicing > Orders to Invoice*.
#. Select one sales order to invoice. If none, use usual sales flows to get one.
#. Click on *Action > Invoice Order*, or access it and click on the
"Create Invoice" button.
#. On the popup that appears, select "Percentage of the quantity" on the
"Create invoice" selection, and put a percentage quantity.
#. Click on "Create and View Invoice" button.
#. On the newly created invoice, you'll see that the invoiced quantity is the
expressed percentage.

Known issues / Roadmap
======================

- You can put any percentage in the field, including amounts higher than 100%,
or negative ones. This can be seen as a disadvantage, or an extra feature.

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20sale_order_invoicing_qty_percentage%0Aversion:%2013.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
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`__:

* Pedro M. Baeza

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.

.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px
:target: https://github.com/pedrobaeza
:alt: pedrobaeza

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pedrobaeza|

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/13.0/sale_order_invoicing_qty_percentage>`_ 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 sale_order_invoicing_qty_percentage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
15 changes: 15 additions & 0 deletions sale_order_invoicing_qty_percentage/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sales order invoicing by percentage of the quantity",
"version": "15.0.1.0.0",
"category": "Sales Management",
"license": "AGPL-3",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"depends": ["sale"],
"data": ["wizards/sale_advance_payment_inv_views.xml"],
"installable": True,
"maintainers": ["pedrobaeza"],
}
63 changes: 63 additions & 0 deletions sale_order_invoicing_qty_percentage/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_invoicing_qty_percentage
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-17 12:20+0000\n"
"PO-Revision-Date: 2023-02-17 13:21+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,help:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__advance_payment_method
msgid ""
"A standard invoice is issued with all the order lines ready for "
"invoicing, according to their invoicing policy (based on ordered or "
"delivered quantity)."
msgstr ""
"Se emite una factura estándar con todas las líneas de pedido listas para la "
"facturación, de acuerdo con su política de facturación (basada en la "
"cantidad pedida o entregada)."

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,field_description:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__advance_payment_method
msgid "Create Invoice"
msgstr "Crear Factura"

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields.selection,name:sale_order_invoicing_qty_percentage.selection__sale_advance_payment_inv__advance_payment_method__qty_percentage
msgid "Percentage of the quantity"
msgstr "Porcentaje de la cantidad"

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,field_description:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__qty_percentage
msgid "Quantity percentage"
msgstr "Porcentaje de la cantidad"

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model,name:sale_order_invoicing_qty_percentage.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr "Ventas. Anticipo pago factura"

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model,name:sale_order_invoicing_qty_percentage.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de pedido de venta"

#~ msgid "Display Name"
#~ msgstr "Nombre mostrado"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_invoicing_qty_percentage
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.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: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,help:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__advance_payment_method
msgid ""
"A standard invoice is issued with all the order lines ready for invoicing,"
" according to their invoicing policy (based on ordered or delivered "
"quantity)."
msgstr ""

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,field_description:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__advance_payment_method
msgid "Create Invoice"
msgstr ""

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields.selection,name:sale_order_invoicing_qty_percentage.selection__sale_advance_payment_inv__advance_payment_method__qty_percentage
msgid "Percentage of the quantity"
msgstr ""

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model.fields,field_description:sale_order_invoicing_qty_percentage.field_sale_advance_payment_inv__qty_percentage
msgid "Quantity percentage"
msgstr ""

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model,name:sale_order_invoicing_qty_percentage.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""

#. module: sale_order_invoicing_qty_percentage
#: model:ir.model,name:sale_order_invoicing_qty_percentage.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
3 changes: 3 additions & 0 deletions sale_order_invoicing_qty_percentage/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import sale_order
15 changes: 15 additions & 0 deletions sale_order_invoicing_qty_percentage/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class SaleOrder(models.Model):
_inherit = "sale.order.line"

def _prepare_invoice_line(self, **optional_values):
"""If invoicing by quantity percentage, modify quantities."""
res = super()._prepare_invoice_line(**optional_values)
if self.env.context.get("qty_percentage"):
res["quantity"] *= self.env.context["qty_percentage"]
return res
3 changes: 3 additions & 0 deletions sale_order_invoicing_qty_percentage/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* Pedro M. Baeza
5 changes: 5 additions & 0 deletions sale_order_invoicing_qty_percentage/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module allows to invoice a percentage of the sales order, modifying
invoiced quantities according such percentage.

Example: You have a service line to invoice 10 hours. You choose to invoice
a 50% of the quantity, so the generated invoice line has 5 hours.
2 changes: 2 additions & 0 deletions sale_order_invoicing_qty_percentage/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- You can put any percentage in the field, including amounts higher than 100%,
or negative ones. This can be seen as a disadvantage, or an extra feature.
9 changes: 9 additions & 0 deletions sale_order_invoicing_qty_percentage/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#. Go to *Sales > Invoicing > Orders to Invoice*.
#. Select one sales order to invoice. If none, use usual sales flows to get one.
#. Click on *Action > Invoice Order*, or access it and click on the
"Create Invoice" button.
#. On the popup that appears, select "Percentage of the quantity" on the
"Create invoice" selection, and put a percentage quantity.
#. Click on "Create and View Invoice" button.
#. On the newly created invoice, you'll see that the invoiced quantity is the
expressed percentage.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading