Allow sharing records between company * accounts * taxes * fiscal positions * products * ...and some related models These records can be read and used in children companies. This can be used to * have different branding for different businesses * allow more complex security rules * consolidate branches differently * manage different tax reports with different tax ids in the same country task-3371677 closes odoo/odoo#125642 Related: odoo/enterprise#43215 Signed-off-by: Quentin De Paoli <qdp@odoo.com>
28 lines
1015 B
Python
28 lines
1015 B
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class ResCompany(models.Model):
|
|
_inherit = "res.company"
|
|
|
|
expense_product_id = fields.Many2one(
|
|
"product.product",
|
|
string="Default Expense Category",
|
|
check_company=True,
|
|
domain="[('can_be_expensed', '=', True), '|', ('company_id', '=', False), ('company_id', '=', company_id)]",
|
|
)
|
|
expense_journal_id = fields.Many2one(
|
|
"account.journal",
|
|
string="Default Expense Journal",
|
|
check_company=True,
|
|
domain="[('type', '=', 'purchase')]",
|
|
help="The company's default journal used when an employee expense is created.",
|
|
)
|
|
company_expense_allowed_payment_method_line_ids = fields.Many2many(
|
|
"account.payment.method.line",
|
|
string="Payment methods available for expenses paid by company",
|
|
check_company=True,
|
|
domain="[('payment_type', '=', 'outbound'), ('journal_id', '!=', False)]",
|
|
)
|