Update project_invoice

This commit is contained in:
zainab2097 2024-09-09 17:33:42 +03:00 committed by GitHub
parent 5f3f52ec2e
commit aa752239cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,8 @@ class ProjectInvoice(models.Model):
'invoice_line_ids': [], 'invoice_line_ids': [],
'company_id': self.company_id.id, 'company_id': self.company_id.id,
'invoice_date_due': self.plan_payment_date, 'invoice_date_due': self.plan_payment_date,
'res_model':'project.invoice',
'res_id':self.id
} }
elif self.project_id.type == 'expense': elif self.project_id.type == 'expense':
journal = self.env['account.move'].sudo().with_context(default_move_type='in_invoice')._get_default_journal() journal = self.env['account.move'].sudo().with_context(default_move_type='in_invoice')._get_default_journal()
@ -196,6 +198,8 @@ class ProjectInvoice(models.Model):
'purchase_id': self.invoice_type== 'consultant' and False or self.project_id.purchase_order_id.id , 'purchase_id': self.invoice_type== 'consultant' and False or self.project_id.purchase_order_id.id ,
'company_id': self.company_id.id, 'company_id': self.company_id.id,
'invoice_date_due': self.plan_payment_date, 'invoice_date_due': self.plan_payment_date,
'res_model':'project.invoice',
'res_id':self.id
} }
return invoice_vals return invoice_vals