This question has been flagged

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")

XMl

<odoo>
  <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'/>
      </field>
    </field>
  </record>

  <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"/>
      </field>
    </field>
  </record>
</odoo>

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


Avatar
Discard
Author

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.