mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_variable_qty_timesheet: Migration to 12.0
* Standard procedure * README by fragments * Promoted to Production/Stable and declared maintainers * Code adapted to v12 * Tests added
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2018 Tecnativa - Carlos Dauden
|
||||
Copyright 2019 Tecnativa - Pedro M. Baeza
|
||||
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),
|
||||
('account_id', '=', line.analytic_account_id.id),
|
||||
('product_id', '=', False),
|
||||
('project_id', '!=', False),
|
||||
('date', '>=', line.date_from),
|
||||
('date', '<=', line.date_to),
|
||||
('date', '>=', period_first_date),
|
||||
('date', '<=', period_last_date),
|
||||
], fields=['unit_amount'], groupby=[])
|
||||
result = group and group[0]['unit_amount'] or 0.0
|
||||
</field>
|
||||
@@ -19,11 +20,11 @@ result = group and group[0]['unit_amount'] or 0.0
|
||||
<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),
|
||||
('account_id', '=', line.analytic_account_id.id),
|
||||
('product_id', '=', False),
|
||||
('task_id', '!=', False),
|
||||
('date', '>=', line.date_from),
|
||||
('date', '<=', line.date_to),
|
||||
('date', '>=', period_first_date),
|
||||
('date', '<=', period_last_date),
|
||||
], fields=['unit_amount'], groupby=[])
|
||||
result = group and group[0]['unit_amount'] or 0.0
|
||||
</field>
|
||||
@@ -32,10 +33,10 @@ result = group and group[0]['unit_amount'] or 0.0
|
||||
<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),
|
||||
('account_id', '=', line.analytic_account_id.id),
|
||||
('product_id', '=', line.product_id.id),
|
||||
('date', '>=', line.date_from),
|
||||
('date', '<=', line.date_to),
|
||||
('date', '>=', period_first_date),
|
||||
('date', '<=', period_last_date),
|
||||
], fields=['unit_amount'], groupby=[])
|
||||
result = group and group[0]['unit_amount'] or 0.0
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user