Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1794 มุมมอง

This is in "report_saledetails.xml" on line  27

<tr t-foreach='products' t-as='line'>

    <t t-set="internal_reference"t-value="line['code'] and '[%s] ' % line['code'] or ''"/>

        <td><t t-esc="internal_reference"/><tt-esc="line['product_name']"/>td>

i would like to know how 'products' refers to the recordset and where "line['product_name']" or "line['code']" is gotten from because these fields are not in the model (pos_session) the report is linked with 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Here the template name for the report is "report_saledetails" , there is a corresponding abstract model created for this reporting template named as "report.point_of_sale.report_saledetails" in this 
model there is a function named as "get_sale_details" , some datas are passed in the return of this function on line 1437 as a dictionary, inside it there is another listdict with the key as "products" , 
so in the template they loop products list dict as "line" and take the line['product_name'] and line['code']

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 24
1862
1
มิ.ย. 23
2736
1
เม.ย. 23
2329
3
เม.ย. 24
6658
0
มี.ค. 24
745