Add default value on company_id field of pricelist

This commit is contained in:
Alexis de Lattre
2017-05-21 23:05:19 +02:00
committed by Raphaël Valyi
parent 41bfd4fc6c
commit fc29b2b480
2 changed files with 14 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from . import product
from . import pricelist

View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class ProductPricelist(models.Model):
_inherit = 'product.pricelist'
company_id = fields.Many2one(
default=lambda self: self.env['res.company']._company_default_get(
'product.pricelist'))