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

[18.0][MIG] contract_variable_quantity #1139

Draft
wants to merge 52 commits into
base: 18.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5d4eafc
[ADD] contract_variable_quantity:
pedrobaeza Sep 9, 2016
dfd507b
[IMP] contract_variable_quantity: Screenshot
pedrobaeza Sep 9, 2016
124f35a
[IMP] contract_variable_quantity: Spanish translation
pedrobaeza Sep 9, 2016
f32ed19
[IMP] contract: Add past receipt type. Fix yearly. Add month last day
carlosdauden Sep 11, 2016
d4b599f
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
bf944b2
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
0e8d2aa
[MIG] contract_variable_quantity: Migrate to v10
lasley Nov 30, 2016
1124a78
[IMP][10.0] contract: Add templating (#42)
lasley Apr 1, 2017
5b9b11f
[10.0][IMP] Add variable qty to contract template view (#66)
lasley Jun 9, 2017
77b2761
[FIX] contract_payment_auto: Fix freze wkhtmltopdf freezed
moylop260 Nov 10, 2017
9725bff
[MIG] contract_variable_quantity: Migration to 11.0
carlosdauden Jan 9, 2018
7c9a86e
[FIX] contract_variable_quantity: Correct README menus references
pedrobaeza Jan 11, 2018
01ed155
[IMP] contract_variable_quantity: Add option to don't create zero qty…
carlosdauden Mar 27, 2018
5d8e6cb
[IMP] contract_variable_quantity: Make name translatable
pedrobaeza Mar 29, 2018
caf5462
[IMP] contract_variable_quantity: Recompute price when changing qty
pedrobaeza Apr 24, 2018
1867c61
[FIX] analytic invoice/contract lines inheritance
katyukha Jun 26, 2018
b47adf9
Update addon versions
katyukha Jul 12, 2018
2c979ff
[MIG] contract_variable_quantity: Migration to 12.0
sbejaoui Nov 6, 2018
1162ca1
[IMP] Adapt unit test
sbejaoui Nov 6, 2018
78fa398
[IMP] - Add ace-widget with python mode
sbejaoui Nov 6, 2018
dfd0f6a
[IMP] - Adapt contract_variable_quantity to contract new views
sbejaoui Nov 23, 2018
ecd1b14
[IMP] - refresh contract_variable_quantity.pot
sbejaoui Nov 26, 2018
bd7c005
[REF] Contract: invoice in prepare_invoice_line is optional
ThomasBinsfeld Dec 18, 2018
8a743a8
[IMP] - Skip zero should ignore lines with qty zero even for fixed qty
sbejaoui Dec 28, 2018
ef2ec92
[FIX] - Fix unit tests
sbejaoui Jan 3, 2019
88afb37
[FIX] fix unit tests
sbejaoui Jan 4, 2019
dae7580
[FIX] - fix check quantity = 0
sbejaoui Jan 7, 2019
21874fc
[REF] - Use method _get_quantity_to_invoice.
sbejaoui Mar 11, 2019
303b9df
[12.0][REF] - Contract Variable quantity: split from analytic accoun
sbejaoui Sep 30, 2019
fe1053e
[FIX] add missing newlines in readme files
gurneyalex Oct 14, 2019
46875c8
[FIX] - redundant fields in contract line form view
sbejaoui Oct 25, 2019
4ac0fa5
[FIX] contract_variable_quantity: Allow to propagate variable qty fie…
pedrobaeza Nov 4, 2019
012b89c
[IMP] contract: remove redundant method
pedrobaeza Jan 8, 2020
c48bbf4
[IMP] contract: add section and notes in contract line
Mar 17, 2020
7bc085f
[IMP] contract_variable_quantity: black, isort, prettier
CarlosRoca13 Oct 27, 2020
00dc105
[MIG] contract_variable_quantity: Migration to v13
CarlosRoca13 Oct 27, 2020
5d60e2d
[IMP] contract_variable_quantity: Add qty_type field in portal
victoralmau Jan 4, 2021
eb0fb33
FIX variable quantity view
angelmoya Jan 31, 2021
13504cf
[IMP] contract_variable_quantity: black, isort, prettier
victoralmau Sep 23, 2021
dd75a0d
[MIG] contract_variable_quantity: Migration to 14.0
victoralmau Sep 23, 2021
73e844b
[MIG] contract_variable_quantity: Migration to 15.0
victoralmau Nov 3, 2022
b37a84e
[MIG] contract_variable_quantity: Migration to 16.0
carolinafernandez-tecnativa Jan 5, 2024
fcbe538
[16.0][IMP] contract and contract_variable_quantity: improve visual o…
aliciagaarzo Apr 1, 2024
18d40c4
Translated using Weblate (Italian)
mymage May 6, 2024
3bacfc5
Translated using Weblate (Croatian)
badbole Jun 17, 2024
9a5f101
Translated using Weblate (Swedish)
jakobkrabbe Jun 18, 2024
3fdfbc0
[IMP] contract_variable_quantity: pre-commit auto fixes
juanjosesegui-tecnativa Jul 22, 2024
838261d
[MIG] contract_variable_quantity: Migration to 17.0
juanjosesegui-tecnativa Jul 22, 2024
0fa5a5e
[UPD] Update contract_variable_quantity.pot
Aug 19, 2024
d76449e
[BOT] post-merge updates
OCA-git-bot Aug 19, 2024
0ff31e9
Update translation files
weblate Aug 19, 2024
b2868a2
[18.0][MIG] contract_variable_quantity
sbejaoui Nov 4, 2024
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
122 changes: 122 additions & 0 deletions contract_variable_quantity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
=================================================
Variable quantity in contract recurrent invoicing
=================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bf5c154ac65588fc280046147b7f3d978557cfe2cd62bd08acf47761e173da74
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.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-18-0/contract-18-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=18.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
=============

1. Go to Invoicing > Configuration > Contracts > Formulas (quantity).

2. 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.

|image1|

.. |image1| image:: https://raw.githubusercontent.com/OCA/contract/18.0/contract_variable_quantity/images/formula_form.png

Usage
=====

To use this module, you need to:

1. Go to Invoicing > Customers > Customers Contracts and select or
create a new contract.
2. Check *Generate recurring invoices automatically*.
3. Add a new recurring invoicing line.
4. Select "Variable quantity" in column "Qty. type".
5. 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:%2018.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
- Juan José Seguí

- 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/18.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": "18.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,
}
227 changes: 227 additions & 0 deletions contract_variable_quantity/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
# 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
#. odoo-python
#: 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__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
#. odoo-python
#: 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
Loading