Adding validity dates for product supplier price

96 views
Skip to first unread message

Maxime Richez

unread,
Jul 5, 2016, 4:43:18 AM7/5/16
to tryton
Hi,

I would like to add start_date and  end_date for a product supplier price.

Here's my code:

http://pastebin.com/Bm9GwTps

My problem:

get_purchase_price method is called  from PurchaseLine with a specific context (purchase_date,...) then get_purchase_price check if there's product_supplier_price matching.
How to keep previous context to check if purchase_date is between start_date and end_date ?
Thanks for your help !

Cédric Krier

unread,
Jul 6, 2016, 6:10:23 AM7/6/16
to tryton
I do not understand. The context inside the execution of
get_purchase_price stays the same. So what do you name "previous
context"?

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Maxime Richez

unread,
Jul 6, 2016, 6:21:57 AM7/6/16
to tryton

I do not understand. The context inside the execution of
get_purchase_price stays the same. So what do you name "previous
context"?

i mean, inside the method get_purchase_price, the method get_pattern from ProductSupplierPrice is called. Has the method get_pattern the same context  ? because when try to get 'purchase_date' from the context, it doesn't seems to find the variable.

have i choose the best way (see my code) using get_pattern and surcharging "match" method for returning a product supplier price between 2 dates ?

Cédric Krier

unread,
Jul 6, 2016, 6:35:03 AM7/6/16
to tryton
On 2016-07-06 03:21, Maxime Richez wrote:
>
> >
> >
> > I do not understand. The context inside the execution of
> > get_purchase_price stays the same. So what do you name "previous
> > context"?
> >
> > i mean, inside the method get_purchase_price, the method get_pattern from
> ProductSupplierPrice is called. Has the method get_pattern the same
> context ? because when try to get 'purchase_date' from the context, it
> doesn't seems to find the variable.

Yes calls inside a method get the same context (except if
Transaction.set_context is called).

> have i choose the best way (see my code) using get_pattern and surcharging
> "match" method for returning a product supplier price between 2 dates ?

Yes I think.

Maxime Richez

unread,
Jul 6, 2016, 9:40:37 AM7/6/16
to tryton
Don't understand, today it's working correctly but i didn't change anything in my code...

Should this little feature suggested to the community, or keep it as a local change ?

Cédric Krier

unread,
Jul 19, 2016, 12:10:06 PM7/19/16
to tryton
The problem I see with such feature is that the price list is going to
grow indefinitely. Also usually you can not anticipate the change in
prices of the supplier so editing with the current price should be good
enough.

Albert Cervera i Areny

unread,
Jul 21, 2016, 5:46:53 PM7/21/16
to try...@googlegroups.com
2016-07-19 18:08 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
On 2016-07-06 06:40, Maxime Richez wrote:
> Don't understand, today it's working correctly but i didn't change anything
> in my code...
>
> Should this little feature suggested to the community, or keep it as a
> local change ?

The problem I see with such feature is that the price list is going to
grow indefinitely. Also usually you can not anticipate the change in
prices of the supplier so editing with the current price should be good
enough.

That highly depends on the industry. In some of them, suppliers update prices yearly and the company want the new prices to take effect on the right date. It is also interesting in some cases to know when the new prices where given by the supplier and what is the expected "expiry" date of the price to know if you need to ask for a new quotation or you can count on the price you have to make a sale quotation for example.

We had a module that added the "start" and end dates on "product.supplier" table in OpenERP and although we don't need it right now, we are interested in such feature.
 

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20160719160831.GI6791%40tetsuo.



--
Albert Cervera i Areny
http://www.NaN-tic.com
Tel. 93 553 18 03

Cédric Krier

unread,
Jul 22, 2016, 1:10:03 AM7/22/16
to try...@googlegroups.com
On 2016-07-21 23:46, Albert Cervera i Areny wrote:
> 2016-07-19 18:08 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
>
> > On 2016-07-06 06:40, Maxime Richez wrote:
> > > Don't understand, today it's working correctly but i didn't change
> > anything
> > > in my code...
> > >
> > > Should this little feature suggested to the community, or keep it as a
> > > local change ?
> >
> > The problem I see with such feature is that the price list is going to
> > grow indefinitely. Also usually you can not anticipate the change in
> > prices of the supplier so editing with the current price should be good
> > enough.
> >
>
> That highly depends on the industry. In some of them, suppliers update
> prices yearly and the company want the new prices to take effect on the
> right date. It is also interesting in some cases to know when the new
> prices where given by the supplier and what is the expected "expiry" date
> of the price to know if you need to ask for a new quotation or you can
> count on the price you have to make a sale quotation for example.

Please can you give me an example of such industry?

Richard PALO

unread,
Jul 22, 2016, 1:20:58 AM7/22/16
to try...@googlegroups.com
Le 22/07/16 07:08, Cédric Krier a écrit :
>> That highly depends on the industry. In some of them, suppliers update
>> prices yearly and the company want the new prices to take effect on the
>> right date. It is also interesting in some cases to know when the new
>> prices where given by the supplier and what is the expected "expiry" date
>> of the price to know if you need to ask for a new quotation or you can
>> count on the price you have to make a sale quotation for example.
>
> Please can you give me an example of such industry?
>
One common example is any installation service company (electricity, plumbing, HVAC, etc...)

--
Richard PALO

Cédric Krier

unread,
Jul 22, 2016, 3:20:03 AM7/22/16
to try...@googlegroups.com
But I do not see why such design is needed for this. For me, updating
the price on the right date is a simple design and probably more
effective.
Also the price list of product supplier is just a default and will
always be. The right price is always given by the supplier.

Àngel Àlvarez Serra

unread,
Jul 22, 2016, 4:10:12 AM7/22/16
to try...@googlegroups.com
2016-07-22 9:17 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
On 2016-07-22 07:21, Richard PALO wrote:
> Le 22/07/16 07:08, Cédric Krier a écrit :
> >> That highly depends on the industry. In some of them, suppliers update
> >> prices yearly and the company want the new prices to take effect on the
> >> right date. It is also interesting in some cases to know when the new
> >> prices where given by the supplier and what is the expected "expiry" date
> >> of the price to know if you need to ask for a new quotation or you can
> >> count on the price you have to make a sale quotation for example.
> >
> > Please can you give me an example of such industry?
> >
> One common example is any installation service company (electricity, plumbing, HVAC, etc...)

But I do not see why such design is needed for this. For me, updating
the price on the right date is a simple design and probably more
effective.
Also the price list of product supplier is just a default and will
always be. The right price is always given by the supplier.



You can negotiate prices with supplier like : 
- 2016:  10 units 1 €
- 2016:  100 units 0.5 €
- 2017: 10 units 0.95€
-2017: 100 units 0.45€

without start and end date you need to write down on spreadsheet waiting to update on your system.


--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

--
You received this message because you are subscribed to the Google Groups "tryton" group.



--
-----------------------------------------------
Àngel Àlvarez [ NaN ]
OpenErp Partner
tel: 652439376
www.nan-tic.com

A NaN Creem,Adaptem i Millorem
Programari lliure pel seu Negoci.

Richard PALO

unread,
Jul 22, 2016, 4:23:41 AM7/22/16
to try...@googlegroups.com
Le 22/07/16 09:17, Cédric Krier a écrit :
> On 2016-07-22 07:21, Richard PALO wrote:
>> Le 22/07/16 07:08, Cédric Krier a écrit :
>>>> That highly depends on the industry. In some of them, suppliers update
>>>> prices yearly and the company want the new prices to take effect on the
>>>> right date. It is also interesting in some cases to know when the new
>>>> prices where given by the supplier and what is the expected "expiry" date
>>>> of the price to know if you need to ask for a new quotation or you can
>>>> count on the price you have to make a sale quotation for example.
>>>
>>> Please can you give me an example of such industry?
>>>
>> One common example is any installation service company (electricity, plumbing, HVAC, etc...)
>
> But I do not see why such design is needed for this. For me, updating
> the price on the right date is a simple design and probably more
> effective.
> Also the price list of product supplier is just a default and will
> always be. The right price is always given by the supplier.
>
>

I guess some practical experience in contracting under fixed price helps
better understand the issue... This holds true for both private and
public tender.

Cost estimations must be very closely regarded and given the contracting
delays which can be in months (typically 3 months minimum) for project
duration that can be in years, it is important to keep tabs on effective
price dates.

Many many contractors have quite a close relation with their business
partners and are in constant dialog with respect to pricing and
conditions. Also, suppliers may naturally have different pricing
policies and compare differently over time.

The actual purchase price may be 'fixed' (potentially in advance via
special quoting by the supplier), but there are vast numbers of
"consumables" that are purchased as needed that have price changes on an
established basis (like 'yearly').

This involves various hardware like supports, nuts/bolts/nails/staples,
isolation, wire, cables and tubes, conduit, glue, tape, ciment, plaster,
paint... well *everything* needed to install technical equipments
correctly (in the example mentioned).

All these greatly affect the bottom line every bit as much as the
man-hours does. (which is also an important revisable item needing
validity dates).

BTW, who has ever received a quote which didn't have a validity clause?

In short, price history is one-thing, but the practical problem area is
in the future... where price validity dates help greatly.

Cédric Krier

unread,
Jul 22, 2016, 4:30:03 AM7/22/16
to try...@googlegroups.com
On 2016-07-22 10:09, Àngel Àlvarez Serra wrote:
> You can negotiate prices with supplier like :
> - 2016: 10 units 1 €
> - 2016: 100 units 0.5 €
> - 2017: 10 units 0.95€
> -2017: 100 units 0.45€
>
> without start and end date you need to write down on spreadsheet waiting to
> update on your system.

Exactly, you do not need to store this information.
Also if you know in 2016 the price of 2017, why do you buy in 2016, it
is more expensive. And if you know the price of 2017 only in 2017, why
do you still need the price of 2016, you can no more buy from there.

Àngel Àlvarez Serra

unread,
Jul 22, 2016, 4:34:30 AM7/22/16
to try...@googlegroups.com
2016-07-22 10:27 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
On 2016-07-22 10:09, Àngel Àlvarez Serra wrote:
> You can negotiate prices with supplier like :
> - 2016:  10 units 1 €
> - 2016:  100 units 0.5 €
> - 2017: 10 units 0.95€
> -2017: 100 units 0.45€
>
> without start and end date you need to write down on spreadsheet waiting to
> update on your system.

Exactly, you do not need to store this information.
Also if you know in 2016 the price of 2017, why do you buy in 2016, it
is more expensive. And if you know the price of 2017 only in 2017, why
do you still need the price of 2016, you can no more buy from there.

Because I negotiate 2017 prices on 2016 and i need to store them.
 

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

--
You received this message because you are subscribed to the Google Groups "tryton" group.

Cédric Krier

unread,
Jul 22, 2016, 4:50:03 AM7/22/16
to try...@googlegroups.com
On 2016-07-22 10:33, Àngel Àlvarez Serra wrote:
> 2016-07-22 10:27 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
>
> > On 2016-07-22 10:09, Àngel Àlvarez Serra wrote:
> > > You can negotiate prices with supplier like :
> > > - 2016: 10 units 1 €
> > > - 2016: 100 units 0.5 €
> > > - 2017: 10 units 0.95€
> > > -2017: 100 units 0.45€
> > >
> > > without start and end date you need to write down on spreadsheet waiting
> > to
> > > update on your system.
> >
> > Exactly, you do not need to store this information.
> > Also if you know in 2016 the price of 2017, why do you buy in 2016, it
> > is more expensive. And if you know the price of 2017 only in 2017, why
> > do you still need the price of 2016, you can no more buy from there.
> >
>
> Because I negotiate 2017 prices on 2016 and i need to store them.

Store them somewhere else, this is a not scalable design.

Raimon Esteve

unread,
Jul 22, 2016, 4:54:11 AM7/22/16
to try...@googlegroups.com
2016-07-22 10:33 GMT+02:00 Àngel Àlvarez Serra <angel.alv...@gmail.com>:
>
>
> 2016-07-22 10:27 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
>>
>> On 2016-07-22 10:09, Àngel Àlvarez Serra wrote:
>> > You can negotiate prices with supplier like :
>> > - 2016: 10 units 1 €
>> > - 2016: 100 units 0.5 €
>> > - 2017: 10 units 0.95€
>> > -2017: 100 units 0.45€
>> >
>> > without start and end date you need to write down on spreadsheet waiting
>> > to
>> > update on your system.
>>
>> Exactly, you do not need to store this information.
>> Also if you know in 2016 the price of 2017, why do you buy in 2016, it
>> is more expensive. And if you know the price of 2017 only in 2017, why
>> do you still need the price of 2016, you can no more buy from there.
>
>
> Because I negotiate 2017 prices on 2016 and i need to store them.

+1

Regards
Reply all
Reply to author
Forward
0 new messages