[IMP] stock_request_analytic: black, isort, prettier

This commit is contained in:
João Marques
2021-04-09 14:31:36 +01:00
committed by Denis Roussel
parent 8ecc0f5054
commit 23d243ff42
11 changed files with 170 additions and 130 deletions

View File

@@ -9,15 +9,22 @@ class StockRequest(models.Model):
_inherit = "stock.request"
analytic_account_id = fields.Many2one(
'account.analytic.account', string='Analytic Account')
analytic_tag_ids = fields.Many2many(
'account.analytic.tag', string='Analytic Tags')
"account.analytic.account", string="Analytic Account"
)
analytic_tag_ids = fields.Many2many("account.analytic.tag", string="Analytic Tags")
@api.constrains('analytic_account_id')
@api.constrains("analytic_account_id")
def _check_analytic_company_constrains(self):
if any(r.company_id and r.analytic_account_id and
r.analytic_account_id.company_id != r.company_id for r in self):
if any(
r.company_id
and r.analytic_account_id
and r.analytic_account_id.company_id != r.company_id
for r in self
):
raise ValidationError(
_('You cannot link a analytic account '
'to a stock request that belongs to '
'another company.'))
_(
"You cannot link a analytic account "
"to a stock request that belongs to "
"another company."
)
)