PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 10, 2022

[FIXED] how to modify value of product_price forcefully using function tag in odoo 11?

 August 10, 2022     decimal, function, odoo-11, python-3.x, xml     No comments   

Issue

I want to change product price =4 how to do by code? this file is product_data in product module.

<record forcecreate="True" id="decimal_price" model="decimal.precision">
        <field name="name">Product Price</field>
        <field name="digits">2</field>
    </record>

Solution

Please try this code:

<!--   Edit Data Record [decimal_price]   -->
<function name="write" model="ir.model.data">
    <function name="search" model="ir.model.data">
        <value eval="[('module', '=', 'product'), ('name', '=', 'decimal_price')]"/>
    </function>
    <value eval="{'noupdate': False}"/>
</function>

<record forcecreate="True" id="product.decimal_price" model="decimal.precision">
    <field name="name">Product Price</field>
    <field name="digits">4</field>
</record>

<function name="write" model="ir.model.data">
    <function name="search" model="ir.model.data">
        <value eval="[('module', '=', 'product'), ('name', '=', 'decimal_price')]"/>
    </function>
    <value eval="{'noupdate': True}"/>
</function>


Answered By - Ahmed Darbi
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing