Posts

Open Many2one field in new Tab (Browser )from Tree View [odoo]

Image
 We can open any Many2one Relational fields from Tree view to New Tab in browser, so that the current Tree view load time will not take much time every time. Add Button in Tree view: ------------------------------ <button name ="action_open_product_document" string ="Open Product Form" icon ="fa-external-link" type ="object" attrs ="{'invisible': [('product_id', '=', False)]}" help ="Click to open the Product Form view as Wizard." /> Add Method in .py file ---------------------------- import werkzeug.urls @api.multi def action_open_product_document ( self ): ctx = self .env.context.copy() action = { 'type' : 'ir.actions.act_window_close' } if self .product_id: ctx.update({ 'create' : 0 , 'edit' : 0 , 'delete' : 0 }) view_type = 'form' model = 'product.product' menu_id = self .env.ref( "stock.me...

Backup/Restored Database is not working and issue with Front-end view [odoo-14.0]

Image
Getting this error while login in the Restored Database.  Problem Statement: ----------------------- 2021-04-19 11:45:34,411 24948 WARNING odoo14_RestoreDB_17Feb2021 odoo.addons.base.models.assetsbundle: Error: Undefined variable: "$mk-brand-gradient-start".         on line 17613 of stdin >> radient: linear-gradient(to right bottom, $mk-brand-gradient-start, $mk-bran    ------------------------------------------^ This error occured while compiling the bundle 'web.assets_backend' containing:     - /web/static/lib/bootstrap/scss/_functions.scss     - /web/static/lib/bootstrap/scss/_mixins.scss     - /web/static/src/scss/bs_mixins_overrides.scss     - /web/static/src/scss/utils.scss     - /muk_web_theme/static/src/scss/mixins.scss     - /web/static/src/scss/primary_variables.scss     - /muk_web_theme/static/src/scss/colors.custom.muk_web_theme._assets_primary_variables.scss  ...

Inherit Group to ADD Remove group implied (inherited) Groups from existing Group in Odoo

Image
We can add/remove implied  i.e. inherited groups in Odoo ERP System. Add remove group from existing group in odoo. Example: In below example, I have one Group i.e. Employee / Officer with inherited User Type / Internal User. Now we will remove Internal User from this group by using inherited code. But before that we have to check for noupdate status. we can check noupdate status by click on,  Button: Action-->Record Info-->XML ID   Action-->Record Info-->XML ID If noupdate boolean is check i.e. True. It means this will not update through the code. So we can set it False either manually or By Code itself then we can write code for add/remove new groups or existing groups. Code: 1. Delete existing group (3-use for delete): <record id ="hr.group_hr_user" model ="res.groups" >      <field name ="implied_ids" eval ="[(3, ref('base.group_user'))]" /> </record> 2. Add new group(4-use for append): <record id =...

Company dependent field is not working in RECORD-RULE DOMAIN with multi-company configured system.

Problem Area: Scenario I want to write a  record rule  with  domain  based on the  company_dependent fields (means that field value is storing in ir.property Model).   Means, I have one field i.e.  x_company_dependent_field   in product.category Model and I want to write one record rule in product. In record-rule domain, I want to compare the product.category field's value with the User fields i.e.  x_any_field (normal field). so that domain on product.product / product.template Model can be like below. Like(domain),   [('categ_id.x_company_dependent_field', '=', user.x_any_field)] Issue with the User Company ID: When we work with multi-company scenario that means if user logged into their account system should show his company in code i.e. self.env.user.company_id . Instead of this everytime system takes ADMIN(2) user company. So that record-rule does not satisfied. Problem-statement Followings are the output from odoo files. file: od...