diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_timesheet_edit/models/account_analytic_line.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/sale_timesheet_edit/models/account_analytic_line.py')
| -rw-r--r-- | addons/sale_timesheet_edit/models/account_analytic_line.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/sale_timesheet_edit/models/account_analytic_line.py b/addons/sale_timesheet_edit/models/account_analytic_line.py new file mode 100644 index 00000000..5ff797dd --- /dev/null +++ b/addons/sale_timesheet_edit/models/account_analytic_line.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models + + +# TODO: [XBO] merge with account.analytic.line in the sale_timesheet module in master. +class AccountAnalyticLine(models.Model): + _inherit = 'account.analytic.line' + + is_so_line_edited = fields.Boolean() + + @api.depends('task_id.sale_line_id', 'project_id.sale_line_id', 'project_id.allow_billable', 'employee_id') + def _compute_so_line(self): + super(AccountAnalyticLine, self.filtered(lambda t: not t.is_so_line_edited))._compute_so_line() + + def _check_sale_line_in_project_map(self): + # TODO: [XBO] remove me in master, now we authorize to manually edit the so_line, then this so_line can be different of the one in task/project/map_entry + # !!! Override of the method in sale_timesheet !!! + return |
