Skip to content

Commit

Permalink
[IMP] contract_variable_qty_timesheet: New module
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdauden authored and Fernando La Chica committed Jan 24, 2021
1 parent 88edf6c commit c4aaf42
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 0 deletions.
68 changes: 68 additions & 0 deletions contract_variable_qty_timesheet/README.rst
Original file line number Diff line number Diff line change
@@ -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
<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 smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.

Contributors
------------

* `Tecnativa <https://www.tecnativa.com>`_:
* 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.
1 change: 1 addition & 0 deletions contract_variable_qty_timesheet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
20 changes: 20 additions & 0 deletions contract_variable_qty_timesheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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',
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 Tecnativa - Carlos Dauden
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

<record id="contract_line_qty_formula_project_timesheet" model="contract.line.qty.formula">
<field name='name'>Project Timesheets</field>
<field name="code">group = env['account.analytic.line'].read_group([
('account_id', '=', contract.id),
('product_id', '=', False),
('project_id', '!=', False),
('date', '&gt;=', line.date_from),
('date', '&lt;=', line.date_to),
], fields=['unit_amount'], groupby=[])
result = group and group[0]['unit_amount'] or 0.0
</field>
</record>

<record id="contract_line_qty_formula_task_timesheet" model="contract.line.qty.formula">
<field name='name'>Task Timesheets</field>
<field name="code">group = env['account.analytic.line'].read_group([
('account_id', '=', contract.id),
('product_id', '=', False),
('task_id', '!=', False),
('date', '&gt;=', line.date_from),
('date', '&lt;=', line.date_to),
], fields=['unit_amount'], groupby=[])
result = group and group[0]['unit_amount'] or 0.0
</field>
</record>

<record id="contract_line_qty_formula_analytic_same_product" model="contract.line.qty.formula">
<field name='name'>Analytic Same Product</field>
<field name="code">group = env['account.analytic.line'].read_group([
('account_id', '=', contract.id),
('product_id', '=', line.product_id.id),
('date', '&gt;=', line.date_from),
('date', '&lt;=', line.date_to),
], fields=['unit_amount'], groupby=[])
result = group and group[0]['unit_amount'] or 0.0
</field>
</record>

</odoo>
Original file line number Diff line number Diff line change
@@ -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 ""

33 changes: 33 additions & 0 deletions contract_variable_qty_timesheet/i18n/es.po
Original file line number Diff line number Diff line change
@@ -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 <carlos.dauden@tecnativa.com>\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"
34 changes: 34 additions & 0 deletions contract_variable_qty_timesheet/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_qty_timesheet
#
# Translators:
# Quentin THEURET <odoo@kerpeo.com>, 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 <odoo@kerpeo.com>, 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"
34 changes: 34 additions & 0 deletions contract_variable_qty_timesheet/i18n/zh.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_variable_qty_timesheet
#
# Translators:
# DIT INTL <ditintlgroup@gmail.com>, 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 <ditintlgroup@gmail.com>, 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 "任务时间表"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c4aaf42

Please sign in to comment.