Merge pull request #934 from expsa/project_test
Update project_invoice.py
This commit is contained in:
commit
49b13222e4
|
|
@ -355,8 +355,12 @@ class ProjectInvoiceLine(models.Model):
|
|||
:param optional_values: any parameter that should be added to the returned invoice line
|
||||
"""
|
||||
self.ensure_one()
|
||||
res = {
|
||||
'name': self.name+'/'+self.project_invoice_id.project_id.name,
|
||||
# Convert to string to avoid TypeError
|
||||
name = str(self.name) if self.name else ''
|
||||
project_name = str(self.project_invoice_id.project_id.name) if self.project_invoice_id and self.project_invoice_id.project_id.name else ''
|
||||
|
||||
res = {
|
||||
'name': name + '/' + project_name,
|
||||
'account_id': self.project_invoice_id.project_id.category_id.account_id and self.project_invoice_id.project_id.category_id.account_id.id or False,
|
||||
'product_id': self.product_id.id,
|
||||
'product_uom_id': self.product_uom.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue