__init__.py 771 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import controllers
  4. from . import models
  5. from . import wizard
  6. from . import report
  7. from odoo import api, SUPERUSER_ID
  8. def uninstall_hook(cr, registry):
  9. env = api.Environment(cr, SUPERUSER_ID, {})
  10. env.ref("account.account_analytic_line_rule_billing_user").write({'domain_force': "[(1, '=', 1)]"})
  11. def _sale_timesheet_post_init(cr, registry):
  12. env = api.Environment(cr, SUPERUSER_ID, {})
  13. products = env['product.template'].search([('detailed_type', '=', 'service'), ('invoice_policy', '=', 'order'), ('service_type', '=', 'manual')])
  14. for product in products:
  15. product.service_type = 'timesheet'
  16. product._compute_service_policy()