diff --git a/contract_variable_qty_timesheet/README.rst b/contract_variable_qty_timesheet/README.rst new file mode 100644 index 000000000..4206a323a --- /dev/null +++ b/contract_variable_qty_timesheet/README.rst @@ -0,0 +1,68 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +=============================== +Contract Variable Qty Timesheet +=============================== + +This module extends the functionality of contract_variable_quantity adding +several variable quantity formulas to allow to invoice lines from Timesheet +(Analytic Lines) + +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 "Project Timesheets", "Tasks Timesheets" or "Analytic Same Product" + depending on your need. + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/110/11.0 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* `Tecnativa `_: + * Carlos Dauden + +Do not contact contributors directly about support or help with technical issues. + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/contract_variable_qty_timesheet/__init__.py b/contract_variable_qty_timesheet/__init__.py new file mode 100644 index 000000000..ef5ae3587 --- /dev/null +++ b/contract_variable_qty_timesheet/__init__.py @@ -0,0 +1 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). diff --git a/contract_variable_qty_timesheet/__manifest__.py b/contract_variable_qty_timesheet/__manifest__.py new file mode 100644 index 000000000..1071b7d73 --- /dev/null +++ b/contract_variable_qty_timesheet/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2018 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + 'name': 'Contract Variable Qty Timesheet', + 'summary': 'Add formula to invoice ', + 'version': '11.0.1.0.0', + 'category': 'Contract Management', + 'website': 'https://github.com/oca/contract', + 'author': 'Tecnativa, ' + 'Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'installable': True, + 'depends': [ + 'contract_variable_quantity', + 'hr_timesheet', + ], + 'data': [ + 'data/contract_line_qty_formula_data.xml', + ], +} diff --git a/contract_variable_qty_timesheet/data/contract_line_qty_formula_data.xml b/contract_variable_qty_timesheet/data/contract_line_qty_formula_data.xml new file mode 100644 index 000000000..0b83b4929 --- /dev/null +++ b/contract_variable_qty_timesheet/data/contract_line_qty_formula_data.xml @@ -0,0 +1,44 @@ + + + + + + Project Timesheets + group = env['account.analytic.line'].read_group([ + ('account_id', '=', contract.id), + ('product_id', '=', False), + ('project_id', '!=', False), + ('date', '>=', line.date_from), + ('date', '<=', line.date_to), +], fields=['unit_amount'], groupby=[]) +result = group and group[0]['unit_amount'] or 0.0 + + + + + Task Timesheets + group = env['account.analytic.line'].read_group([ + ('account_id', '=', contract.id), + ('product_id', '=', False), + ('task_id', '!=', False), + ('date', '>=', line.date_from), + ('date', '<=', line.date_to), +], fields=['unit_amount'], groupby=[]) +result = group and group[0]['unit_amount'] or 0.0 + + + + + Analytic Same Product + group = env['account.analytic.line'].read_group([ + ('account_id', '=', contract.id), + ('product_id', '=', line.product_id.id), + ('date', '>=', line.date_from), + ('date', '<=', line.date_to), +], fields=['unit_amount'], groupby=[]) +result = group and group[0]['unit_amount'] or 0.0 + + + + diff --git a/contract_variable_qty_timesheet/i18n/contract_variable_qty_timesheet.pot b/contract_variable_qty_timesheet/i18n/contract_variable_qty_timesheet.pot new file mode 100644 index 000000000..d4d87538a --- /dev/null +++ b/contract_variable_qty_timesheet/i18n/contract_variable_qty_timesheet.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_variable_qty_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.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: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_analytic_same_product +msgid "Analytic Same Product" +msgstr "" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_project_timesheet +msgid "Project Timesheets" +msgstr "" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_task_timesheet +msgid "Task Timesheets" +msgstr "" + diff --git a/contract_variable_qty_timesheet/i18n/es.po b/contract_variable_qty_timesheet/i18n/es.po new file mode 100644 index 000000000..7281d4ce1 --- /dev/null +++ b/contract_variable_qty_timesheet/i18n/es.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_variable_qty_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-29 11:13+0200\n" +"PO-Revision-Date: 2018-03-29 11:21+0200\n" +"Last-Translator: Carlos Dauden \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: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.7.1\n" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_analytic_same_product +msgid "Analytic Same Product" +msgstr "Analítica mismo producto" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_project_timesheet +msgid "Project Timesheets" +msgstr "Partes de horas de proyectos" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_task_timesheet +msgid "Task Timesheets" +msgstr "Partes de horas de tareas" diff --git a/contract_variable_qty_timesheet/i18n/fr.po b/contract_variable_qty_timesheet/i18n/fr.po new file mode 100644 index 000000000..4b87abfdd --- /dev/null +++ b/contract_variable_qty_timesheet/i18n/fr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_variable_qty_timesheet +# +# Translators: +# Quentin THEURET , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-06 21:09+0000\n" +"PO-Revision-Date: 2018-04-06 21:09+0000\n" +"Last-Translator: Quentin THEURET , 2018\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\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" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_analytic_same_product +msgid "Analytic Same Product" +msgstr "Même produit analytique" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_project_timesheet +msgid "Project Timesheets" +msgstr "Feuilles de temps du projet" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_task_timesheet +msgid "Task Timesheets" +msgstr "Feuille de temps de la tâche" diff --git a/contract_variable_qty_timesheet/i18n/zh.po b/contract_variable_qty_timesheet/i18n/zh.po new file mode 100644 index 000000000..95285088b --- /dev/null +++ b/contract_variable_qty_timesheet/i18n/zh.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_variable_qty_timesheet +# +# Translators: +# DIT INTL , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-27 01:12+0000\n" +"PO-Revision-Date: 2018-04-27 01:12+0000\n" +"Last-Translator: DIT INTL , 2018\n" +"Language-Team: Chinese (https://www.transifex.com/oca/teams/23907/zh/)\n" +"Language: zh\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_analytic_same_product +msgid "Analytic Same Product" +msgstr "分析同一产品" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_project_timesheet +msgid "Project Timesheets" +msgstr "项目时间表" + +#. module: contract_variable_qty_timesheet +#: model:contract.line.qty.formula,name:contract_variable_qty_timesheet.contract_line_qty_formula_task_timesheet +msgid "Task Timesheets" +msgstr "任务时间表" diff --git a/contract_variable_qty_timesheet/static/description/icon.png b/contract_variable_qty_timesheet/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/contract_variable_qty_timesheet/static/description/icon.png differ