This question has been flagged
2 Replies
2268 Views

i want to add a pdf report to res.partner model 

i'have proceed this way;

<odoo>


    <report

        id="report_user"

        model="res.partner"

        string="Partner Report"

        name="res.partner.report_partner_view"

        file="res.partner.report_partner"

        report_type="qweb-pdf" />


        <template id="report_partner_view">

            <t t-call="web.html_container">

                <t t-foreach="docs" t-as="o">

                    <t t-call="web.external_layout">

                        <t t-set="address">

                            <address t-field="o.id" 

                                    t-options='{"widget": "contact", "fields": ["name", "email", "phone"]}'/>

                        </t>

                        <div class="page">

                            

                        </div>

                    </t>

                </t>

            </t>

        </template>

</odoo>


but i get this error when i click on the print button which indicates that the system couldnt find the extenal id mentioned in the xml file,



 File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1670, in xmlid_lookup raise ValueError('External ID not found in the system: %s' % xmlid) ValueError: External ID not found in the system: res.partner.report_partner_view


i don't know why the system considers the tag "name" as an external id, and not just a human read able nomination tag, was there changes on the version 13 that i am not taking in consideration  ?  


Avatar
Discard
Best Answer

Hi,

What is your module name actually ?
Instead of giving like this,  name="res.partner.report_partner_view" inside the report tag, try like this and see,

name="report_partner_view" or name="custom_module_namereport_partner_view"


Thanks

Avatar
Discard
Author Best Answer

the name of the module is "profile", and i declared a class in where i inherite the res.partner module :

    class extend_contact(models.Model):

    _inherit='res.partner'

    def print_page(self):

        return self.env.ref('print_contact.action_report_page').report_action(self)


i changed my code to be like this time :



    <report

        id="report_user"

        model="res.partner"

        string="Partner Report"

        name="profile.res_partner_form"

file="profile.res_partner"

        report_type="qweb-pdf" />


but still got the same error 


Avatar
Discard