fix inital budget
This commit is contained in:
parent
5928ed0101
commit
43d4536112
|
|
@ -24,6 +24,7 @@ class PurchaseRequest(models.Model):
|
|||
currency_field='company_currency_id', store=True)
|
||||
company_currency_id = fields.Many2one("res.currency", string="Currency", related="company_id.currency_id",
|
||||
readonly=True)
|
||||
budget_id = fields.Many2one('crossovered.budget', string="Budget")
|
||||
|
||||
@api.depends('line_ids', 'line_ids.line_total')
|
||||
def _compute_total_amount(self):
|
||||
|
|
@ -88,8 +89,8 @@ class PurchaseRequest(models.Model):
|
|||
('crossovered_budget_id.date_to', '>=', self.date)])
|
||||
|
||||
budget_line = budget_lines.mapped('crossovered_budget_id')
|
||||
if len(budget_line) > 1:
|
||||
self.budget_id = budget_line[0].id
|
||||
# if len(budget_line) > 1:
|
||||
self.budget_id = budget_line[0].id
|
||||
if budget_lines:
|
||||
remain = abs(budget_lines.remain)
|
||||
amount = amount + rec.line_total
|
||||
|
|
|
|||
Loading…
Reference in New Issue