How to use price lists

247 views
Skip to first unread message

Tom Schutter

unread,
Oct 8, 2011, 5:36:09 PM10/8/11
to tryton
I am using Tryton 2.0.1. I have created a price list and added some
products to it.

Now what do I do?
How can I see a price list with prices in it?
Can I generate a report via libreoffice of the price list? How do I do
that?

Cédric Krier

unread,
Oct 8, 2011, 6:09:33 PM10/8/11
to tryton
On 08/10/11 14:36 -0700, Tom Schutter wrote:
> I am using Tryton 2.0.1. I have created a price list and added some
> products to it.
>
> Now what do I do?
> How can I see a price list with prices in it?

Price list are not use here in the common way.
It is a set of rules to compute the price of each product.
So a price list is composed of a ordered list of lines. A line is composed of
a pattern (by default 'product' and quantity) and a formula.
So when a price is computed, Tryton will find the first line that matches and
use the formula to compte the price.

> Can I generate a report via libreoffice of the price list? How do I do
> that?

As it is a computed list that could depend on many things (especially the
quantity) it is not really doable in a generic way.

--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/

Tom Schutter

unread,
Oct 8, 2011, 7:56:05 PM10/8/11
to tryton
On Sun 2011-10-09 00:09, C�dric Krier wrote:
> On 08/10/11 14:36 -0700, Tom Schutter wrote:
> > I am using Tryton 2.0.1. I have created a price list and added some
> > products to it.
> >
> > Now what do I do?
> > How can I see a price list with prices in it?
>
> Price list are not use here in the common way.
> It is a set of rules to compute the price of each product.
> So a price list is composed of a ordered list of lines. A line is composed of
> a pattern (by default 'product' and quantity) and a formula.
> So when a price is computed, Tryton will find the first line that matches and
> use the formula to compte the price.

Aha. Maybe it should be called "Price Rulesets" instead?

> > Can I generate a report via libreoffice of the price list? How do I do
> > that?
>
> As it is a computed list that could depend on many things (especially the
> quantity) it is not really doable in a generic way.

In my case, the pricing is always the same no matter what the quantity.
Would that make it any easier?

--
Tom Schutter
t.sch...@comcast.net

Cédric Krier

unread,
Oct 9, 2011, 2:25:42 AM10/9/11
to tryton
On 08/10/11 17:56 -0600, Tom Schutter wrote:

> On Sun 2011-10-09 00:09, Cédric Krier wrote:
> > On 08/10/11 14:36 -0700, Tom Schutter wrote:
> > > I am using Tryton 2.0.1. I have created a price list and added some
> > > products to it.
> > >
> > > Now what do I do?
> > > How can I see a price list with prices in it?
> >
> > Price list are not use here in the common way.
> > It is a set of rules to compute the price of each product.
> > So a price list is composed of a ordered list of lines. A line is composed of
> > a pattern (by default 'product' and quantity) and a formula.
> > So when a price is computed, Tryton will find the first line that matches and
> > use the formula to compte the price.
>
> Aha. Maybe it should be called "Price Rulesets" instead?

Not sure. At the end it is a price list that is generated.

> > > Can I generate a report via libreoffice of the price list? How do I do
> > > that?
> >
> > As it is a computed list that could depend on many things (especially the
> > quantity) it is not really doable in a generic way.
>
> In my case, the pricing is always the same no matter what the quantity.
> Would that make it any easier?

Yes of course. Indeed I just think that we could have a report that will take
a set of quantity to compute.

Sasa Ostrouska

unread,
Oct 9, 2011, 6:49:31 AM10/9/11
to try...@googlegroups.com
On Sun, Oct 9, 2011 at 8:25 AM, Cédric Krier <cedric...@b2ck.com> wrote:
> On 08/10/11 17:56 -0600, Tom Schutter wrote:
>> On Sun 2011-10-09 00:09, Cédric Krier wrote:
>> > On 08/10/11 14:36 -0700, Tom Schutter wrote:
>> > > I am using Tryton 2.0.1.  I have created a price list and added some
>> > > products to it.
>> > >
>> > > Now what do I do?
>> > > How can I see a price list with prices in it?
>> >
>> > Price list are not use here in the common way.
>> > It is a set of rules to compute the price of each product.
>> > So a price list is composed of a ordered list of lines. A line is composed of
>> > a pattern (by default 'product' and quantity) and a formula.
>> > So when a price is computed, Tryton will find the first line that matches and
>> > use the formula to compte the price.
>>
>> Aha.  Maybe it should be called "Price Rulesets" instead?
>
> Not sure. At the end it is a price list that is generated.
>

Personally I would agree on call them price rulesets if its not a
price list. This of course depends on how you look at the thing. For
example, aprice list in a business world is a list of items and
various data, like weight, dimensions, volume and of course price for
a single item.

From another view, at the end, is just a list with single unit prices.
So price per unit.

I think the name is misleading in that case.

>> > > Can I generate a report via libreoffice of the price list? How do I do
>> > > that?
>> >
>> > As it is a computed list that could depend on many things (especially the
>> > quantity) it is not really doable in a generic way.
>>
>> In my case, the pricing is always the same no matter what the quantity.
>> Would that make it any easier?
>
> Yes of course. Indeed I just think that we could have a report that will take
> a set of quantity to compute.
>
> --
> Cédric Krier
>
> B2CK SPRL
> Rue de Rotterdam, 4
> 4000 Liège
> Belgium
> Tel: +32 472 54 46 59
> Email/Jabber: cedric...@b2ck.com
> Website: http://www.b2ck.com/
>

Rgds
Saxa

Ian Wilson

unread,
Oct 10, 2011, 2:08:13 PM10/10/11
to try...@googlegroups.com

--
try...@googlegroups.com mailing list

This confused me the first time I used it as well.  I think the name is misleading; maybe this could be solved with some documentation on how to use the module.

Avraham Serour

unread,
Oct 10, 2011, 2:23:23 PM10/10/11
to try...@googlegroups.com
btw can I define a differnet price list for each client for the same products?

say that for the same product I sell for a different price for each client.

--
try...@googlegroups.com mailing list

Cédric Krier

unread,
Oct 10, 2011, 2:33:20 PM10/10/11
to try...@googlegroups.com
On 10/10/11 20:23 +0200, Avraham Serour wrote:
> btw can I define a differnet price list for each client for the same
> products?

Yes, you can link a price list to a party.

PS: Please read
https://groups.google.com/d/msg/tryton/-IA9TLq5qag/pv5okIVkr38J

Tom Schutter

unread,
Oct 10, 2011, 10:44:08 PM10/10/11
to tryton
On Sun 2011-10-09 08:25, C�dric Krier wrote:
> On 08/10/11 17:56 -0600, Tom Schutter wrote:
> > On Sun 2011-10-09 00:09, C�dric Krier wrote:
> > > On 08/10/11 14:36 -0700, Tom Schutter wrote:
> > > > Can I generate a report via libreoffice of the price list? How do I do
> > > > that?
> > >
> > > As it is a computed list that could depend on many things (especially the
> > > quantity) it is not really doable in a generic way.
> >
> > In my case, the pricing is always the same no matter what the quantity.
> > Would that make it any easier?
>
> Yes of course. Indeed I just think that we could have a report that will take
> a set of quantity to compute.

1) What can I do to help a price list report become real?

2) Meanwhile is it possible for me to create a custom report that would
do this? I have found
http://doc.tryton.org/2.0/trytond/doc/topics/reports/index.html#topics-reports,
but it has a steep learning curve. Are there any Tryton specific examples?

--
Tom Schutter
t.sch...@comcast.net

Cédric Krier

unread,
Oct 11, 2011, 3:19:00 AM10/11/11
to tryton
On 10/10/11 20:44 -0600, Tom Schutter wrote:

> On Sun 2011-10-09 08:25, Cédric Krier wrote:
> > On 08/10/11 17:56 -0600, Tom Schutter wrote:
> > > On Sun 2011-10-09 00:09, Cédric Krier wrote:
> > > > On 08/10/11 14:36 -0700, Tom Schutter wrote:
> > > > > Can I generate a report via libreoffice of the price list? How do I do
> > > > > that?
> > > >
> > > > As it is a computed list that could depend on many things (especially the
> > > > quantity) it is not really doable in a generic way.
> > >
> > > In my case, the pricing is always the same no matter what the quantity.
> > > Would that make it any easier?
> >
> > Yes of course. Indeed I just think that we could have a report that will take
> > a set of quantity to compute.
>
> 1) What can I do to help a price list report become real?

- You can submit a patch (see [1])
- You can hire one of the companies [2]
- You can submit a feature request [3]

> 2) Meanwhile is it possible for me to create a custom report that would
> do this? I have found
> http://doc.tryton.org/2.0/trytond/doc/topics/reports/index.html#topics-reports,
> but it has a steep learning curve. Are there any Tryton specific examples?

I think it will require to use a wizard to ask for the quantity.


[1] https://code.google.com/p/tryton/wiki/HowtoContribute
[2] http://www.tryton.org/services.html
[3] https://elveos.org/en/softwares/852?name=tryton

Tom Schutter

unread,
Oct 16, 2011, 6:33:30 PM10/16/11
to tryton
On Tue 2011-10-11 09:19, C�dric Krier wrote:
> On 10/10/11 20:44 -0600, Tom Schutter wrote:
> > On Sun 2011-10-09 08:25, C�dric Krier wrote:
> > > On 08/10/11 17:56 -0600, Tom Schutter wrote:
> > > > On Sun 2011-10-09 00:09, C�dric Krier wrote:
> > > > > On 08/10/11 14:36 -0700, Tom Schutter wrote:
> > > > > > Can I generate a report via libreoffice of the price list? How do I do
> > > > > > that?
> > > > >
> > > > > As it is a computed list that could depend on many things (especially the
> > > > > quantity) it is not really doable in a generic way.
> > > >
> > > > In my case, the pricing is always the same no matter what the quantity.
> > > > Would that make it any easier?
> > >
> > > Yes of course. Indeed I just think that we could have a report that will take
> > > a set of quantity to compute.
> >
> > 1) What can I do to help a price list report become real?
>
> - You can submit a patch (see [1])

I have been attempting to create a report based upon the doc at
http://doc.tryton.org/2.0/trytond/doc/topics/reports/index.html#topics-reports

I have created a price_list.odt that should work.

I understand what needs to be added to price_list.xml

But I can't see how to actually attach the report to the UI. I suspect
that the empty "Report API" and "Python API" sections of the Reports doc
would tell me what I need to know if well, they were not empty.

Examining other reports doesn't shed enough light. Sometimes there
appear to be report-related objects in the Python source such as
PickingList in stock/shipment.py, but I can't decypher the why and the
how.

I have the skills, but I am lacking the knowledge of Tryton internals.

--
Tom Schutter
t.sch...@comcast.net

Cédric Krier

unread,
Oct 16, 2011, 6:58:28 PM10/16/11
to tryton
On 16/10/11 16:33 -0600, Tom Schutter wrote:
> But I can't see how to actually attach the report to the UI. I suspect
> that the empty "Report API" and "Python API" sections of the Reports doc
> would tell me what I need to know if well, they were not empty.
>
> Examining other reports doesn't shed enough light. Sometimes there
> appear to be report-related objects in the Python source such as
> PickingList in stock/shipment.py, but I can't decypher the why and the
> how.
>
> I have the skills, but I am lacking the knowledge of Tryton internals.

You must create a record "ir.action.report" like in

http://hg.tryton.org/2.0/modules/party/file/0795dfec273a/party.xml#l146

Tom Schutter

unread,
Oct 18, 2011, 9:00:17 AM10/18/11
to tryton
On Mon 2011-10-17 00:58, C�dric Krier wrote:
> On 16/10/11 16:33 -0600, Tom Schutter wrote:
> > But I can't see how to actually attach the report to the UI. I suspect
> > that the empty "Report API" and "Python API" sections of the Reports doc
> > would tell me what I need to know if well, they were not empty.
> >
> > Examining other reports doesn't shed enough light. Sometimes there
> > appear to be report-related objects in the Python source such as
> > PickingList in stock/shipment.py, but I can't decypher the why and the
> > how.
> >
> > I have the skills, but I am lacking the knowledge of Tryton internals.
>
> You must create a record "ir.action.report" like in
>
> http://hg.tryton.org/2.0/modules/party/file/0795dfec273a/party.xml#l146

I have this in price_list.xml:

<record model="ir.action.report" id="report_price_list">
<field name="name">Price List</field>
<field name="model">product.price_list</field>
<field name="report_name">product.price_list</field>
<field name="report">product_price_list/price_list.odt</field>
<field name="style">company/header_A4.odt</field>
</record>
<record model="ir.action.keyword" id="report_price_list_keyword">
<field name="keyword">form_print</field>
<field name="model">product.price_list,0</field>
<field name="action" ref="report_price_list"/>
</record>

--
Tom Schutter
t.sch...@comcast.net

Ariel Stilman

unread,
Jun 27, 2017, 11:00:07 AM6/27/17
to tryton
Hi Cedric, @Hasan_i_Sabbah here. Seems impossible to find out about this module. Could use your help, Thank you!

Ariel

unread,
Jun 27, 2017, 11:00:09 AM6/27/17
to tryton
Please explain hot to create a price list for different client in order to set all my product portfolio with different margin for different client. also it is possible to manage Margin. Also I was unable to figure out hot to modify price formulas.

Cédric Krier

unread,
Jun 27, 2017, 1:05:07 PM6/27/17
to tryton
On 2017-06-27 07:19, Ariel wrote:
> Please explain hot to create a price list for different client in order to
> set all my product portfolio with different margin for different client.

You have to create a price list for each party and link it on the party
form.

> also it is possible to manage Margin.

Margin is just a formula on the price list.

> Also I was unable to figure out hot
> to modify price formulas.

Without more information it is difficult to help.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/

Ariel Stilman

unread,
Jun 29, 2017, 2:30:08 PM6/29/17
to tryton
thanks. I get it. Let me ask you what type of Formulas can be input ?
I´m trying to set a formula to calculate the selling price including a Margin % over cost_price.
I notice Formulas are set using python expressions yet an error occurs alerting  product.cost_price or cost_price are not defined

I can use unit_price*1.10 to add 10% onver price BUT I cant use cost_price/(1-0.20) to add 20% margin formula over cost. I also cant use Decimal(round(product.cost_price*1.10,2)) to add 10% with 2 decimals.

So which formulas can I use? Which variables are acceptable for price, cost, quantity etc.

Cédric Krier

unread,
Jun 29, 2017, 2:55:06 PM6/29/17
to tryton
On 2017-06-29 10:50, Ariel Stilman wrote:
> thanks. I get it. Let me ask you what type of Formulas can be input ?

Any valid Python expression.

> I´m trying to set a formula to calculate the selling price including a
> Margin % over cost_price.
> I notice Formulas are set using python expressions yet an error occurs
> alerting product.cost_price

You can not browse instance. We use a restricted evaluator for security
purpose (see https://github.com/danthedeckie/simpleeval)

> or cost_price are not defined

Not by default.

> I can use unit_price*1.10 to add 10% onver price BUT I cant use
> cost_price/(1-0.20) to add 20% margin formula over cost.

Yep the cost_price is not in the default context.
We do not put the cost price because a product can be configured to have
an average cost method and so in this case the computed price will
always change.

> I also cant use
> Decimal(round(product.cost_price*1.10,2)) to add 10% with 2 decimals.

round is neither in the context but you should be able to use
Decimal.quantize (which is more precise)

> So which formulas can I use? Which variables are acceptable for price,
> cost, quantity etc.

By default only 'unit_price' is defined, but the module is designed to
allow extention to add more names and functions to the simpleeval
context.
The design of Tryton is to have simple default but easy extensibility.


PS: Please do no top-post on this mailing list, see
https://groups.tryton.org/netiquette
Reply all
Reply to author
Forward
0 new messages