fix button action budget
This commit is contained in:
parent
64cb00836d
commit
9b8b61ff47
|
|
@ -14,7 +14,7 @@ class BudgetConfirmationCustom(models.Model):
|
|||
if self.expense_id and self.type == 'expense':
|
||||
self.expense_id.write({'state': 'draft'})
|
||||
self.expense_id.message_post(body=_(
|
||||
"Rejected By : %s With Reject Reason : %s" % (str(self.env.user.name), str(self.reject_reason))))
|
||||
"Rejected By : %s With Reject Reason : %s" % (str(self.env.user.name), str(self.reject_reason or self.env.context.get('reject_reason','')))))
|
||||
|
||||
def done(self):
|
||||
super(BudgetConfirmationCustom, self).done()
|
||||
|
|
@ -149,9 +149,11 @@ class AccountMove(models.Model):
|
|||
else:
|
||||
budget_line = budget_lines[0]
|
||||
remain = abs(budget_line.remain)
|
||||
amount = self.total_amount
|
||||
tax_id = self.tax_ids[0].analytic if self.tax_ids else False
|
||||
price_before_tax= self.unit_amount* self.quantity
|
||||
tax_price = self.total_amount - price_before_tax
|
||||
amount = price_before_tax + (tax_price if tax_id else 0)
|
||||
new_remain = remain - amount
|
||||
|
||||
data = {
|
||||
'name': _('Expense: %s') % self.employee_id.name,
|
||||
'date': self.date,
|
||||
|
|
|
|||
Loading…
Reference in New Issue