summaryrefslogtreecommitdiff
path: root/addons/sale_timesheet
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2020-12-22 12:30:34 +0000
committerGoffin Simon <sig@odoo.com>2020-12-22 13:42:09 +0000
commit8d658abc9c60149b0ac63772cdb76dcbd8080cde (patch)
treeea63dbf3ba05c53c4bd9b3a7644a2d3e7a60d8ae /addons/sale_timesheet
parentee2ca9cb4c4172479fb949ad7a9726c7aaac6021 (diff)
[FIX] sale_timesheet: Record rule not updated
Steps to reproduce the bug: - Install Accounting, Sales, Project and Timesheet apps - Enable Analytic accounting in Accounting settings - Uninstall Timesheet app Bug: The domain_force of was account.analytic.line.billing.user still equal to [('project_id', '=', False)] but the field project_id didn't exist on model account_analytic_line. opw:2420177 closes odoo/odoo#63687 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons/sale_timesheet')
-rw-r--r--addons/sale_timesheet/__init__.py7
-rw-r--r--addons/sale_timesheet/__manifest__.py1
2 files changed, 8 insertions, 0 deletions
diff --git a/addons/sale_timesheet/__init__.py b/addons/sale_timesheet/__init__.py
index 7d7e07d0b8c..211c0d74460 100644
--- a/addons/sale_timesheet/__init__.py
+++ b/addons/sale_timesheet/__init__.py
@@ -4,3 +4,10 @@ from . import controllers
from . import models
from . import wizard
from . import report
+
+from odoo import api, SUPERUSER_ID
+
+def uninstall_hook(cr, registry):
+ env = api.Environment(cr, SUPERUSER_ID, {})
+
+ env.ref("account.account_analytic_line_rule_billing_user").write({'domain_force': "[(1, '=', 1)]"})
diff --git a/addons/sale_timesheet/__manifest__.py b/addons/sale_timesheet/__manifest__.py
index 577e5cba62c..e27005cf5f6 100644
--- a/addons/sale_timesheet/__manifest__.py
+++ b/addons/sale_timesheet/__manifest__.py
@@ -41,4 +41,5 @@ have real delivered quantities in sales orders.
'data/sale_service_demo.xml',
],
'auto_install': True,
+ 'uninstall_hook': 'uninstall_hook',
}