[13.0][FIX] account_financial_report: Correct all uses of

self.env.user.company_id. Also move company_id to the
wizard abstract model.
This commit is contained in:
Lois Rilo
2020-10-21 11:44:14 +02:00
committed by chaule97
parent 8b9bad9807
commit 31bed0f68f
11 changed files with 20 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
# Copyright 2019 Lorenzo Battistini @ TAKOBI
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
from odoo import fields, models
class AbstractWizard(models.AbstractModel):
@@ -27,3 +27,10 @@ class AbstractWizard(models.AbstractModel):
partners -= corp_partners
partners |= corp_partners.mapped("commercial_partner_id")
return partners.ids
company_id = fields.Many2one(
comodel_name="res.company",
default=lambda self: self.env.company.id,
required=False,
string="Company",
)