Umme Huzaifa How to add an attribute instead of replacing an existing field in odoo 13? For example, for an existing field "percent_commission", we will add an attribute "readonly". Here is the format: <field name ="percent_commission" position ="attributes" > <attribute name ="readon...
Umme Huzaifa How to add Two different views for the same model in Odoo 13? Suppose we want to add two different views for a custom model name 'purchase.req'. One is for the base user and another is for the manager. <record model ="ir.actions.act_window" id ="purchase_o...
Umme Huzaifa How do Restrict Users to show their own Entries only? Use a domain filter using [('user_id', '=', uid)] Here is an example below: <record model="ir.actions.act_window" id="purchase_order_action"> <field name="name">Purchase Requisition</field> <field...
Umme Huzaifa HOW TO GET THE CURRENT LOGIN USER ID IN THE FIELD? There are several ways to get this. One of the easiest solutions is to use compute field. Example: current_user_id = fields.Many2one('res.users', string='Current User', readonly=True, compute="_comput...
Umme Huzaifa How to compare fields in a filter? Suppose I want to compare the user_id field with the currently logged-in user id. Since we cannot use two field names in the filter, There is a solution here. We can use another field to check this. H...
Umme Huzaifa How To Inherit an Action Button and Add a Confirmation Message in Odoo Suppose you want to add a confirmation message to a purchase order. Here is an example below: <record id ="view_purchase_order_form_confirm_msg" model ="ir.ui.view" > <field name ="name" > view.pu...
Umme Huzaifa How To Fix Invoice Line Value Missing On Saving issue || Adding Field in Invoice Line Suppose we have a custom field free_quantityty in the invoice line. But when we save the invoice the value is disappeared. The reason is that there are two One2Many fields in this model (account.move)...
Umme Huzaifa How to zoom image in odoo? Here is an example of zooming in on a picture: <div> <field name="image_1920" widget="image" class="oe_avatar" options='{"zoom": true, "preview_image":"image_1920", "zoom_delay": 1000}'/> </di...
Umme Huzaifa How to inherit an action and add a default filter? Solution: Here is an example of how to add default group by States in employee Payslip tree view in odoo 11. <xpath expr="//search" position="inside"> <filter name="state" string="States" domain="[]...
Umme Huzaifa TypeError: strptime() argument 1 must be str, not datetime.date I want to get the month and year from the field date in odoo 13. But I got this error : TypeError: strptime() argument 1 must be str, not datetime.date Here is my code: @api.depends('date_...
Umme Huzaifa How to pass custom field value from sale.order.line to account.move.line in odoo 13? Suppose, You have a field name free_quantity in sale.order.line and you have a filed with the same name in the account.move.line and you want to pass the field value to the account.move.line. Solutio...
Umme Huzaifa How to pass custom field value from purchase.order.line to account.move.line in odoo 13 Suppose, You have a field name free_quantity in purchase.order.line and you have a filed with the same name in the account.move.line and you want to pass the field value to the account.move.line. S...