mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2026-08-19 01:34:43 -05:00
19 lines
579 B
Python
19 lines
579 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from . import models
|
|
|
|
from flectra import api, SUPERUSER_ID
|
|
|
|
|
|
def _assign_default_nomeclature_id(cr, registry):
|
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
company_ids_without_default_nomenclature_id = env['res.company'].search([
|
|
('nomenclature_id', '=', False)
|
|
])
|
|
default_nomenclature_id = env.ref('barcodes.default_barcode_nomenclature', raise_if_not_found=False)
|
|
if default_nomenclature_id:
|
|
company_ids_without_default_nomenclature_id.write({
|
|
'nomenclature_id': default_nomenclature_id.id,
|
|
})
|
|
|