Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to set the Price Security in OpenERP(Odoo)?

    • 0
    • 2
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 280
    Comment on it

    Step-1 Install the Price Security module.
    Step-2 After that custmozie .py(Python file) file:
    In below example, I have custmozied .py file. You can directly copy the below python code in your .py file.

    class account_invoice_line(models.Model):
        _inherit = 'account.invoice.line'
    
        product_can_modify_prices = fields.Boolean(
            related='product_id.can_modify_prices',
            readonly=True,
            string='Product Can modify prices')
    
        @api.one
        @api.constrains(
            'discount', 'product_can_modify_prices')
        def check_discount(self):
            if self.user_has_groups('price_security.group_restrict_prices') and not self.product_can_modify_prices and self.invoice_id:
                self.env.user.check_discount(
                    self.discount,
                    self.invoice_id.partner_id.property_product_pricelist.id)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: