Odoo Help

Welcome!

This community 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.

0

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

By
maharshi
on 8/1/16, 5:49 AM 320 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")

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.


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.

maharshi
on 8/1/16, 10:21 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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