Hello,
I want to include a count for the number of lines present in my table (include products, sections, notes).
How can I achieve that?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I want to include a count for the number of lines present in my table (include products, sections, notes).
How can I achieve that?
Hi,
If you need the information inside a report template, you can just add this line of code in the needed place: len(doc.order_line)
Thanks
<t t-esc="len(doc.order_line)"/>
Hi,
from odoo import models, fields, api
class SaleOrder(models.Model):
_inherit = 'sale.order'
line_count = fields.Integer(string='Number of Lines',
compute='_compute_line_count')
def _compute_line_count(self):
for order in self:
order.line_count = len(order.order_line)
the order_line length includes the section and note values
Hope it helps
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
Accounting - Profit and Loss by Month
Diselesaikan
|
|
3
Okt 24
|
7486 | |
|
3
Sep 24
|
5263 | ||
|
3
Sep 24
|
3457 | ||
|
1
Sep 24
|
1898 | ||
|
0
Des 24
|
1627 |