Skip to content

Commit

Permalink
Merge PR #1027 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jan 8, 2024
2 parents 11c08aa + ae8947a commit a55defa
Show file tree
Hide file tree
Showing 97 changed files with 17,756 additions and 0 deletions.
116 changes: 116 additions & 0 deletions contract_variable_quantity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
=================================================
Variable quantity in contract recurrent invoicing
=================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f186109da38da1bb524348308da9f6f58d233204f646f60e843ce133deeacf09
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/16.0/contract_variable_quantity
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_variable_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/contract&target_branch=16.0
:alt: Try me on Runboat

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

With this module, you will be able to define in recurring contracts some
lines with variable quantity according to a provided formula.

**Table of contents**

.. contents::
:local:

Configuration
=============

#. Go to Invoicing > Configuration > Contracts > Formulas (quantity).
#. Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable 'result'.

You can use these variables to compute your formula:

* *env*: Environment variable for getting other models.
* *context*: Current context dictionary.
* *user*: Current user.
* *line*: Contract recurring invoice line that triggers this formula.
* *contract*: Contract whose line belongs to.
* *invoice*: Invoice (header) being created.

.. figure:: https://raw.githubusercontent.com/OCA/contract/16.0/contract_variable_quantity/images/formula_form.png
:alt: Formula form
:width: 600 px

Usage
=====

To use this module, you need to:

#. Go to Invoicing > Sales > Contracts and select or create a new contract.
#. Check *Generate recurring invoices automatically*.
#. Add a new recurring invoicing line.
#. Select "Variable quantity" in column "Qty. type".
#. Select one of the possible formulas to use (previously created).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/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/contract/issues/new?body=module:%20contract_variable_quantity%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
~~~~~~~

* Tecnativa

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

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

* Pedro M. Baeza
* Carlos Roca
* Víctor Martínez
* Carolina Fernandez

* Dave Lasley <[email protected]>
* Souheil Bejaoui <[email protected]>

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/contract <https://github.com/OCA/contract/tree/16.0/contract_variable_quantity>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions contract_variable_quantity/__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 models
25 changes: 25 additions & 0 deletions contract_variable_quantity/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2016-2019 Tecnativa - Pedro M. Baeza
# Copyright 2018 Tecnativa - Carlos Dauden
# Copyright 2019 ACSONE SA/NV
# Copyright 2024 Tecnativa - Carolina fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Variable quantity in contract recurrent invoicing",
"version": "16.0.1.0.0",
"category": "Contract Management",
"license": "AGPL-3",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/contract",
"depends": ["contract"],
"data": [
"security/ir.model.access.csv",
"views/abstract_contract_line.xml",
"views/contract_line_formula.xml",
"views/contract_line_views.xml",
"views/contract_template.xml",
"views/contract.xml",
"views/contract_portal_templates.xml",
],
"installable": True,
}
230 changes: 230 additions & 0 deletions contract_variable_quantity/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_quantity
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-11 02:47+0000\n"
"PO-Revision-Date: 2016-09-11 02:47+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"Language: am\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: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<code>\n"
" result =\n"
" env['product.product']."
"search_count([('sale_ok',\n"
" '=', True)])\n"
" </code>"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "<i>context</i>: Current context dictionary."
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<i>contract</i>: Contract whose line\n"
" belongs to."
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<i>env</i>: Environment variable for\n"
" getting other models."
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<i>invoice</i>: Invoice (header) being\n"
" created."
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"<i>line</i>: Contract recurring invoice\n"
" line that triggers this formula."
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "<i>user</i>: Current user."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model,name:contract_variable_quantity.model_contract_abstract_contract_line
msgid "Abstract Recurring Contract Line"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.actions.act_window,help:contract_variable_quantity.action_contract_quantity_formula
msgid "Click to create a new formula for variable quantities."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__code
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "Code"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model,name:contract_variable_quantity.model_contract_contract
msgid "Contract"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model,name:contract_variable_quantity.model_contract_line
msgid "Contract Line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model,name:contract_variable_quantity.model_contract_line_qty_formula
msgid "Contract Line Formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__create_uid
msgid "Created by"
msgstr "Creado por"

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__create_date
msgid "Created on"
msgstr "Creado en"

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__display_name
msgid "Display Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract_line_formula.py:0
#, python-format
msgid ""
"Error evaluating code.\n"
"Details: %s"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "Example of Python code"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_abstract_contract_line__qty_type__fixed
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_line__qty_type__fixed
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_template_line__qty_type__fixed
msgid "Fixed quantity"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.actions.act_window,name:contract_variable_quantity.action_contract_quantity_formula
#: model:ir.ui.menu,name:contract_variable_quantity.menu_contract_quantity_formula
msgid "Formulas (quantity)"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "Help with Python expressions."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__id
msgid "ID"
msgstr "ID"

#. module: contract_variable_quantity
#: model:ir.model.fields,help:contract_variable_quantity.field_contract_contract__skip_zero_qty
msgid "If checked, contract lines with 0 qty don't create invoice line"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula____last_update
msgid "Last Modified on"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__write_date
msgid "Last Updated on"
msgstr "Última actualización en"

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line_qty_formula__name
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid "Name"
msgstr ""

#. module: contract_variable_quantity
#: code:addons/contract_variable_quantity/models/contract_line_formula.py:0
#, python-format
msgid "No valid result returned."
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_abstract_contract_line__qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line__qty_formula_id
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_template_line__qty_formula_id
msgid "Qty. formula"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_abstract_contract_line__qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_line__qty_type
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_template_line__qty_type
msgid "Qty. type"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields,field_description:contract_variable_quantity.field_contract_contract__skip_zero_qty
msgid "Skip Zero Qty Lines"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.portal_contract_page
msgid "Variable"
msgstr ""

#. module: contract_variable_quantity
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_abstract_contract_line__qty_type__variable
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_line__qty_type__variable
#: model:ir.model.fields.selection,name:contract_variable_quantity.selection__contract_template_line__qty_type__variable
msgid "Variable quantity"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"You can use these variables to compute your\n"
" formula:"
msgstr ""

#. module: contract_variable_quantity
#: model_terms:ir.ui.view,arch_db:contract_variable_quantity.view_contract_line_qty_formula_form
msgid ""
"You have to insert valid Python code block that\n"
" stores at some moment a float/integer value "
"of\n"
" the quantity to invoice in the variable\n"
" 'result'."
msgstr ""
Loading

0 comments on commit a55defa

Please sign in to comment.