add correct info
This commit is contained in:
parent
217e7dc3d1
commit
bb73384d10
|
|
@ -190,6 +190,9 @@ class AccountMove(models.Model):
|
|||
if not line.analytic_account_id:
|
||||
raise ValidationError(_('Please Choose Analytic account for This Bill'))
|
||||
budget_post = self.env['account.budget.post'].search([]).filtered(lambda x: line.account_id in x.account_ids)
|
||||
if len(budget_post.ids) > 1:
|
||||
raise ValidationError(
|
||||
_("The Expense account %s is assigned to more than one budget position %s")%(line.account_id.name,[x.name for x in budget_post]))
|
||||
budget_lines = self.env['crossovered.budget.lines'].search(
|
||||
[('analytic_account_id', '=', line.analytic_account_id.id),
|
||||
('general_budget_id', 'in', budget_post),
|
||||
|
|
|
|||
|
|
@ -142,6 +142,10 @@ class AccountMove(models.Model):
|
|||
def action_budget(self):
|
||||
|
||||
budget_post = self.env['account.budget.post'].search([]).filtered(lambda x: self.account_id in x.account_ids)
|
||||
if len(budget_post.ids) > 1:
|
||||
raise ValidationError(
|
||||
_("The Expense account %s is assigned to more than one budget position %s") % (
|
||||
self.account_id.name, [x.name for x in budget_post]))
|
||||
budget_lines = self.env['crossovered.budget.lines'].search(
|
||||
[('analytic_account_id', '=', self.analytic_account_id.id),
|
||||
('general_budget_id', 'in', budget_post),
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ class PurchaseRequest(models.Model):
|
|||
_("This product has no expense account") + ': {}'.format(rec.product_id.name))
|
||||
|
||||
budget_post = self.env['account.budget.post'].search([]).filtered(lambda x: account_id in x.account_ids)
|
||||
if len(budget_post.ids) > 1:
|
||||
raise ValidationError(
|
||||
_("The Expense account %s is assigned to more than one budget position %s") % (
|
||||
account_id.name, [x.name for x in budget_post]))
|
||||
budget_lines = self.env['crossovered.budget.lines'].search(
|
||||
[('analytic_account_id', '=', analytic_account.id),
|
||||
('general_budget_id', 'in', budget_post.ids),
|
||||
|
|
|
|||
Loading…
Reference in New Issue