|
@ -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', '>=', line.date_from), |
|
|
|
|
|
('date', '<=', 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', '>=', line.date_from), |
|
|
|
|
|
('date', '<=', 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', '>=', line.date_from), |
|
|
|
|
|
('date', '<=', line.date_to), |
|
|
|
|
|
], fields=['unit_amount'], groupby=[]) |
|
|
|
|
|
result = group and group[0]['unit_amount'] or 0.0 |
|
|
|
|
|
</field> |
|
|
|
|
|
</record> |
|
|
|
|
|
|
|
|
|
|
|
</odoo> |