flectra/addons/base_branch_company/models/ir_branch_company.py
2018-01-17 10:43:56 +05:30

16 lines
521 B
Python

# -*- 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)