diff options
| author | qdp-odoo <qdp@odoo.com> | 2020-03-02 13:54:12 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2020-03-26 13:22:58 +0000 |
| commit | 847889b49768db290f86ab5c5f48e8134fa29266 (patch) | |
| tree | 62d0d4f0b317b5e13dcfc319d013bf90abb807af /addons/account/models/account_analytic_line.py | |
| parent | 4a93f93e405a2e2a6bcb538eeb12e6507ceaa99a (diff) | |
[FIX] analytic, account: multi company fixes
added _check_company_auto and check_company attributes on relevant objects
Was task 2206523
closes odoo/odoo#46586
Related: odoo/enterprise#8986
Related: odoo/upgrade#993
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons/account/models/account_analytic_line.py')
| -rw-r--r-- | addons/account/models/account_analytic_line.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py index e5b45e92b1f..35737d8ab75 100644 --- a/addons/account/models/account_analytic_line.py +++ b/addons/account/models/account_analytic_line.py @@ -55,11 +55,11 @@ class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' _description = 'Analytic Line' - product_id = fields.Many2one('product.product', string='Product', domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]") + product_id = fields.Many2one('product.product', string='Product', check_company=True) general_account_id = fields.Many2one('account.account', string='Financial Account', ondelete='restrict', readonly=True, - related='move_id.account_id', store=True, domain=[('deprecated', '=', False)], + related='move_id.account_id', store=True, domain="[('deprecated', '=', False), ('company_id', '=', company_id)]", compute_sudo=True) - move_id = fields.Many2one('account.move.line', string='Journal Item', ondelete='cascade', index=True) + move_id = fields.Many2one('account.move.line', string='Journal Item', ondelete='cascade', index=True, check_company=True) code = fields.Char(size=8) ref = fields.Char(string='Ref.') |
