Hello all,
I am currently using Odoo 13 Community.
I would like to show on the invoice only the sales description of each product, but not the internal ID and the product name.
As an example:
[123] table
Sales description: Table 160x80cm
Current output on invoice is:
[123] Table
Table 160x80cm
What I desire:
Table 160x80cm
If someone could help me with that, I would be super happy!
Thanks a lot!
Translated with www.DeepL.com/Translator (free version)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
Hi Paul:
You can customize the Invoice document and replace the field you don't want with the Sales Description field.
You can do that by develop a custom app and inherit account.move.line model and override method _get_computed_name as below:
If you want to get only sales description in Customer Invoice & purchase description in vendor bill:
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
def _get_computed_name(self):
self.ensure_one()
if not self.product_id:
return ''
if self.partner_id.lang:
product = self.product_id.with_context(lang=self.partner_id.lang)
else:
product = self.product_id
values = []
# if product.partner_ref:
# values.append(product.partner_ref)
if self.journal_id.type == 'sale':
if product.description_sale:
values.append(product.description_sale)
elif self.journal_id.type == 'purchase':
if product.description_purchase:
values.append(product.description_purchase)
return '\n'.join(values)
If you want to get only sales description in Customer Invoice and get product code and product name and purchase description in vendor bill, you will use the below:
def _get_computed_name(self):
self.ensure_one()
if not self.product_id:
return ''
if self.partner_id.lang:
product = self.product_id.with_context(lang=self.partner_id.lang)
else:
product = self.product_id
values = []
# if product.partner_ref:
# values.append(product.partner_ref)
# values.append(product.partner_ref)
if self.journal_id.type == 'sale':
if product.description_sale:
values.append(product.description_sale)
elif self.journal_id.type == 'purchase':
if product.partner_ref:
values.append(product.partner_ref)
if product.description_purchase:
values.append(product.description_purchase)
return '\n'.join(values)
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
1
Okt 22
|
3941 | ||
|
3
Jul 19
|
6457 | ||
Add 'Invoiced' smart button in Product Template
Diselesaikan
|
|
1
Mar 16
|
6168 | |
|
2
Mar 15
|
4419 | ||
|
0
Mar 15
|
3586 |