[FIX] stock: clean-up sequences at uninstall
When stock is uninstalled, the sequences used in the warehouses for the picking types are kept. However, since [1], picking types cannot be duplicated anymore. When the module is re-installed, the picking types are created with the same name, which is not allowed by [1]. [1]: https://github.com/odoo/odoo/commit/9034602a028fb22fbd139cf41a2f5c71d9d8d032 opw-3484352 closes odoo/odoo#135036 X-original-commit: 7b0f38fea8bc9a541972d29f289e6175ee15919b Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
This commit is contained in:
@@ -24,3 +24,7 @@ def _assign_default_mail_template_picking_id(env):
|
||||
company_ids_without_default_mail_template_id.write({
|
||||
'stock_mail_confirmation_template_id': default_mail_template_id.id,
|
||||
})
|
||||
|
||||
def uninstall_hook(env):
|
||||
picking_type_ids = env["stock.picking.type"].with_context({"active_test": False}).search([])
|
||||
picking_type_ids.sequence_id.unlink()
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
'application': True,
|
||||
'pre_init_hook': 'pre_init_hook',
|
||||
'post_init_hook': '_assign_default_mail_template_picking_id',
|
||||
'uninstall_hook': 'uninstall_hook',
|
||||
'assets': {
|
||||
'web.report_assets_common': [
|
||||
'stock/static/src/scss/report_stock_reception.scss',
|
||||
|
||||
Reference in New Issue
Block a user