Sunday, December 6, 2020

open specific view from many2one field

 ODOO 



In this case we have many2one field for model that has more than one view and we want to open specific view from this field for this model

let us give an example :

- we have model "object.a" and model "object.b", in which we have object_a_id field as bellow 

object_a_id = fields.Many2one('object.a', string="Object A")

 

- model "object.a" has two form view with ids "object_a_form_view_1" and "object_a_form_view_2" and "object_a_form_view_1" id the default view and we want to show the other view from object_a_id field , so we can do it by add the field in the xml file as bellow

 

<field name="object_a_id" context="{'form_view_ref':'module_name.object_a_form_view_2',}" />

Thursday, December 3, 2020

OperationalError: FATAL: the database system is starting up

ODOO



The error above happen when the postgres database service can not start , so to fix it we have to restart the postgres by opening the terminal and write the command bellow 

sudo service postgresql restart

Tuesday, December 1, 2020

The tag is deprecated, use a tag for

 ODOO 

odoo 14


 

"The <report> tag is deprecated, use a <record> tag for ...etc "

some time you can get the error above when you create new report tin odoo 14.0 because 90% created it as bellow ,

<report
            id="report_action_id"
            string="Report Name"
            model="model.name"
            report_type="qweb-html"
            name="module_name.report_temp_id"
            menu="True"
        />


But , You have to create it as bellow to fix this error 

 

<record id="report_action_id" model="ir.actions.report">
        <field name="name">Report Name</field>
        <field name="model">model.name</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">module_name.report_temp_id</field>
        <field name="report_file">module_name.report_temp_id</field>
        <field name="binding_model_id" ref="model.name"/>
        <field name="binding_type">report</field>

</record>

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...