Files
odoo_source/addons/l10n_it_stock_ddt/__init__.py
T
Josse Colpaert 65fe57bd20 [FIX] delivery: avoid tests to fail with l10n_*
The problem is that the cache still thinks in the test that
it is in EUR and then it does a currency conversion for calculating the
delivery cost and the test will fail in L105 of test_delivery_stock.py

By invalidating the cache after the sql that change the currency of the
company, we solve it.
(someone should refactor those tests though)

closes odoo/odoo#67790

X-original-commit: f0a1e7c35bd8cd17149d1d54bfe5b9eec12a0814
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-12 20:45:15 +00:00

18 lines
639 B
Python

# -*- coding: utf-8 -*-
from . import models
from odoo import api, SUPERUSER_ID
def _create_picking_seq(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
ptypes = env['stock.picking.type'].search([('code', '=', 'outgoing'), ('warehouse_id', '!=', False)])
for ptype in ptypes:
wh = ptype.warehouse_id
ptype.l10n_it_ddt_sequence_id = env['ir.sequence'].create({
'name': wh.name + ' ' + ' Sequence ' + ' ' + ptype.sequence_code,
'prefix': wh.code + '/' + ptype.sequence_code + '/DDT', 'padding': 5,
'company_id': wh.company_id.id,
'implementation': 'no_gap',
}).id