This commit adds a many2one between barcode.nomenclature and res.company and removes Many2one pointing toward a nomenclature record. This aims to improve the usability and allows using nomenclature in inventory adjustment where a `nomenclature_id` field was set.
17 lines
409 B
Python
17 lines
409 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import models, fields
|
|
|
|
|
|
class ResCompany(models.Model):
|
|
_inherit = 'res.company'
|
|
|
|
def _get_default_nomenclature(self):
|
|
return self.env.ref('barcodes.default_barcode_nomenclature', raise_if_not_found=False)
|
|
|
|
nomenclature_id = fields.Many2one(
|
|
'barcode.nomenclature',
|
|
string="Nomenclature",
|
|
default=_get_default_nomenclature,
|
|
)
|