Odoo Help


How to update the sale order line in Odoo9 for EQP(END QUANTITY PRICE)

on 8/1/16, 5:49 AM 783 views

I want to update the price_unit accourding to the EQP. I have created a boolean in pricelist saying eqp. I have create a boolean in customer card saying eqp. Now in sales order the user will select the customer so i want that if the customer's boolean for eqp is true then he should get the pricelist for which eqp is true for eg. pricelist

(1) min.qty 100 12% discount eqp== false
(2) min.qty 200 15% discount eqp== false
(3) min.qty 300 20% discount eqp== ture

so whatever may be the qty if the customer is eligible for eqp he should get the (3) pricelist.

Heres the code so far

from openerp import models, fields, api

class product_pricelist_item(models.Model):
    _inherit= 'product.pricelist.item'

    eqp_pricelist= fields.Boolean(string="is EQP?")

class res_partner_form(models.Model):
    _inherit= 'res.partner'

    eqp_card= fields.Boolean(string="is EQP?")
    eqp_start= fields.Date(string="EQP Start Date")
    eqp_end= fields.Date(string="EQP End Date")


  <record id='product_pricelist_item_form_view' model='ir.ui.view'>
    <field name='model'>product.pricelist.item</field>
    <field name="inherit_id" ref='product.product_pricelist_item_form_view'/>
    <field name='arch' type='xml'>
      <field name='min_quantity' position='after'>
        <field name='eqp'/>

  <record id='base_view_partner_form' model='ir.ui.view'>
    <field name='model'>res.partner</field>
    <field name='inherit_id' ref='base.view_partner_form'/>
    <field name='arch' type="xml">
      <field name="website" position="after">
        <field name="eqp"/>
        <field name="eqp_start"/>
        <field name="eqp_end"/>

I don't know which def to override in sale.py file.

Atleast provide some suggestions as to where do i need to look in product.py/sale.py. Please provide some idea. Give me a starting point

can i implement in such a way that it would only consider the eqp-pricelist for starters have you any idea how is that achieved.Like it wont check anything just take the eqp-pricelist ...will give me an idea.

on 8/1/16, 10:21 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/1/16, 5:49 AM
Seen: 783 times
Last updated: 8/1/16, 5:52 AM