Files
odoo_source/addons/barcodes/models/res_company.py
T
William Henrotin 95a9572da3 [REF] barcodes, stock, point_of_sale: one nomenclature per company
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.
2018-09-10 13:33:42 +02:00

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,
)