Skip to content
Snippets Groups Projects
Commit 30b00e5c authored by Ricardo Gomes Rodrigues (rigr)'s avatar Ricardo Gomes Rodrigues (rigr)
Browse files

[FIX] l10n_it_stock_ddt: condition to create the l10n_it_ddt_sequence_id


The condition to create is wrongly evaluated and does not take into account
the country code and the picking type code. This commit fixes this by
reordering the conditions.

closes odoo/odoo#133146

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent 408175a7
No related branches found
No related tags found
No related merge requests found
......@@ -74,8 +74,7 @@ class StockPickingType(models.Model):
@api.model
def create(self, vals):
company = self.env['res.company'].browse(vals.get('company_id', False)) or self.env.company
if 'l10n_it_ddt_sequence_id' not in vals or not vals['l10n_it_ddt_sequence_id'] and vals['code'] == 'outgoing' \
and company.country_id.code == 'IT':
if company.country_id.code == 'IT' and vals['code'] == 'outgoing' and ('l10n_it_ddt_sequence_id' not in vals or not vals['l10n_it_ddt_sequence_id']):
ir_seq_name, ir_seq_prefix = self._get_dtt_ir_seq_vals(vals.get('warehouse_id'), vals['sequence_code'])
vals['l10n_it_ddt_sequence_id'] = self.env['ir.sequence'].create({
'name': ir_seq_name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment