mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_request_analytic: black, isort, prettier
This commit is contained in:
committed by
Denis Roussel
parent
8ecc0f5054
commit
23d243ff42
@@ -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."
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user