flectra/addons/base_branch_company/models/ir_branch_company.py

16 lines
521 B
Python
Raw Normal View History

2018-01-16 13:51:36 +01:00
# -*- coding: utf-8 -*-
# Part of flectra. See LICENSE file for full copyright and licensing details.
from flectra import fields, models
class IrBranchCompanyMixin(models.AbstractModel):
_name = "ir.branch.company.mixin"
branch_id = fields.Many2one(
'res.branch', 'Branch', ondelete="restrict",
default=lambda self: self.env.user.default_branch_id)
company_id = fields.Many2one(
'res.company', 'Company', ondelete="restrict",
default=lambda self: self.env.user.company_id)