I have created a report using qweb , when i need to show the others data from different models it says error "account.invoice object has no attribute 'pack_operation_product_ids'" . My main question here is how to call pack_operation_product_ids from that same module but different object or models. Thanks
PP.xml
<tr t-foreach="o.pack_operation_product_ids" t-as="m">
<tr t-foreach="o.picking_ids" t-as="l">
<td> <span t-field="l.name"/> | <span t-field="m.name"/> </td>
models.py
from odoo import fields,models,api
@api.multi
def get_data(self):
record_collection = []
# Do your browse, search, calculations, .. here and then return the data (which you can then use in the QWeb)
record_collection = self.env['stock.picking'].search([('pack_operation_product_ids', '=', 'o.pack_operation_product_ids')])
return record_collection
return error
AttributeError: 'account.invoice' object has no attribute 'pack_operation_product_ids'
Error to render compiling AST
AttributeError: 'account.invoice' object has no attribute 'pack_operation_product_ids'
Template: invoice_report2.qweb_inv_pp_document
Path: /templates/t/t/t/div/div[3]/div[2]/table/tbody/tr
Node: <tr t-foreach="o.pack_operation_product_ids" t-as="m">
<!-- <tr t-foreach="request.env['stock.picking'].search([(
'pack_operation_product_ids', '=', o.pack_operation_product_ids.name)])" t-as="obj"> -->
<!--<tr t-set="record_collection" t-value="doc.get_data()">-->
<tr t-foreach="o.picking_ids" t-as="l">
<td> <span t-field="l.name"/> | <span t-field="m.name"/> </td>
</tr>
</tr>