__init__.py 634 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import models
  4. from . import report
  5. from . import populate
  6. from . import wizard
  7. from odoo import api, SUPERUSER_ID
  8. def _create_buy_rules(cr, registry):
  9. """ This hook is used to add a default buy_pull_id on every warehouse. It is
  10. necessary if the purchase_stock module is installed after some warehouses
  11. were already created.
  12. """
  13. env = api.Environment(cr, SUPERUSER_ID, {})
  14. warehouse_ids = env['stock.warehouse'].search([('buy_pull_id', '=', False)])
  15. warehouse_ids.write({'buy_to_resupply': True})