Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Richard PALO

I believe as well that supplier purchase categories could or
should probably relate to purchase.product_supplier as opposed to
being dumped on product.template

cheers
--

Richard PALO

--
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/9c2c41a3-3130-f427-9b30-7c07b6e19d0f%40free.fr.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Richard PALO

Le 25/10/2017 à 13:57, Cédric Krier a écrit :

On 2017-10-25 13:47, Richard PALO wrote:

I believe there should be some additional things to consider, typically for 
suppliers
where instead of communicating net prices to their [professional] clients, 
there are:


We don't try to compute instead of the supplier because you do not know
how they compute and any way, it is not needed. The current supplier
price list per quantity is good enough for approximation.



I don't understand what you say here.


1. Fixed reductions : typically by category of product. (e.g. public price - 
50%)


Supported by sale_promotion


This is not the same, promotion is only a punctual reduction, either global or 
by specific
line on the invoice... it is not 'permanent' like the habitual price list 
conditions are.


2. Compound reductions : e.g. 35% + 15% => (public price * (100%-35%)) * 
(100%-15%)


Supported by price list


I see the formula possibility with hard coded coefficients, but I can't seem to 
get the price
list to work at all on suppliers anyway... it simply igores it and uses only 
the price_unit
value on the suppliers form of the product. (though I wonder if the patches for 
issue3797 may
cause any problem here?)



3. There may be as well volume discounts (in absence of a different article 
reference number)


Supported by sale_promotion


again, not the same as with 1.


4. I understand there may be fixed price reductions too (that is, not a 
percentage) in the
currency used, e.g. 1€ (or 1£ or 1€) or what have you...


Also supported by price list and sale_promotion even if it is highly
doubtable because of the currency.


same as 2.

By the way, I tried the standard approach... Purchase order -> reception -> 
Invoice
and directly with invoice (which loses the supplier specifics from issue3797), 
but neither
seem to understand the supplier price list as configued on the supplier price 
list as it seems
to be only for 'sales' and not 'purchases'.

It is primordial to support these on price lists for suppliers as it is 
unacceptable
to force entering line by line standard supplier conditions on articles 
purchased.
There may be hundreds or thousands of lines per month to enter! The forms are 
already
way too verbose for any real-life volume.

--

Richard PALO

--
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/792dc140-e197-0542-a2c5-8c14c5352a05%40free.fr.


Re: [tryton] uWSGI: can't find trytond.application.app

2017-10-25 Thread Cédric Krier
On 2017-10-25 15:39, PMan wrote:
> Thank you.
> 
> I enabled threads in the .ini file but I got the same results:

So you can probably re-disable it.

> (Tryton) root@host [/opt/Tryton]# /opt/python36/bin/uwsgi 
> /opt/Tryton/etc/tryton.ini
> [uWSGI] getting INI configuration from /opt/Tryton/etc/tryton.ini
> *** Starting uWSGI 2.0.15 (64bit) on [Wed Oct 25 16:13:07 2017] ***
> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 05 October 2017 
> 22:04:37
> os: Linux-3.10.0-714.10.2.lve1.4.63.el7.x86_64 #1 SMP Sun Aug 20 17:46:23 EDT 
> 2017
> nodename: host.mysite.com
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 4
> current working directory: /opt/Tryton
> detected binary path: /opt/python36/bin/uwsgi
> setgid() to group
> setuid() to user
> chdir() to /opt/Tryton/trytond-4.4.4/trytond
> your processes number limit is 14335
> your memory page size is 4096 bytes
> detected max file descriptor number: 4096
> lock engine: pthread robust mutexes
> thunder lock: disabled (you can enable it with --thunder-lock)
> uWSGI http bound on :8000 fd 4
> uwsgi socket 0 bound to TCP address 127.0.0.1:29116 (port auto-assigned) fd 3
> Python version: 3.6.2 (default, Aug  5 2017, 01:12:58)  [GCC 4.8.5 20150623 
> (Red Hat 4.8.5-11)]
> PEP 405 virtualenv detected: /opt/Tryton
> Set PythonHome to /opt/Tryton
> Python main interpreter initialized at 0x1eeb9f0
> python threads support enabled
> your server socket listen backlog is limited to 100 connections
> your mercy for graceful operations on workers is 60 seconds
> mapped 166144 bytes (162 KB) for 2 cores
> *** Operational MODE: threaded ***
> /opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules/__init__.py:143:
>  DeprecationWarning: This method will be removed in future versions.  Use 
> 'parser.read_file()' instead.
>   module_config.readfp(fp)
> unable to find "application" callable in file 
> /opt/Tryton/trytond-4.4.4/trytond/application.py
> unable to load app 0 (mountpoint='') (callable not found or import error)

So here it does not find the object to call.
It should be app. I guess you must configure: mountpoint='app' but I can
not confirm because I can not understand the uwsgi documentation.

> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 1339)
> spawned uWSGI worker 1 (pid: 1341, cores: 2)
> spawned uWSGI http 1 (pid: 1342)
> ^CSIGINT/SIGQUIT received...killing workers...
> gateway "uWSGI http 1" has been buried (pid: 1342)
> worker 1 buried after 1 seconds
> goodbye to uWSGI.
> (Tryton) root@host [/opt/Tryton]#
> 
> Maybe it doens't matter, but it seems odd that it's running 
> /opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules/__init__.py
>  instead of /opt/Tryton/trytond-4.4.4/trytond/modules/__init__.py.
> 
> Regards,
> Paul
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@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/20171026001616.GF3623%40kei.


Re: [tryton] uWSGI: can't find trytond.application.app

2017-10-25 Thread PMan
Thank you.

I enabled threads in the .ini file but I got the same results:

(Tryton) root@host [/opt/Tryton]# /opt/python36/bin/uwsgi 
/opt/Tryton/etc/tryton.ini
[uWSGI] getting INI configuration from /opt/Tryton/etc/tryton.ini
*** Starting uWSGI 2.0.15 (64bit) on [Wed Oct 25 16:13:07 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 05 October 2017 
22:04:37
os: Linux-3.10.0-714.10.2.lve1.4.63.el7.x86_64 #1 SMP Sun Aug 20 17:46:23 EDT 
2017
nodename: host.mysite.com
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /opt/Tryton
detected binary path: /opt/python36/bin/uwsgi
setgid() to group
setuid() to user
chdir() to /opt/Tryton/trytond-4.4.4/trytond
your processes number limit is 14335
your memory page size is 4096 bytes
detected max file descriptor number: 4096
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:29116 (port auto-assigned) fd 3
Python version: 3.6.2 (default, Aug  5 2017, 01:12:58)  [GCC 4.8.5 20150623 
(Red Hat 4.8.5-11)]
PEP 405 virtualenv detected: /opt/Tryton
Set PythonHome to /opt/Tryton
Python main interpreter initialized at 0x1eeb9f0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 166144 bytes (162 KB) for 2 cores
*** Operational MODE: threaded ***
/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules/__init__.py:143:
 DeprecationWarning: This method will be removed in future versions.  Use 
'parser.read_file()' instead.
  module_config.readfp(fp)
unable to find "application" callable in file 
/opt/Tryton/trytond-4.4.4/trytond/application.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1339)
spawned uWSGI worker 1 (pid: 1341, cores: 2)
spawned uWSGI http 1 (pid: 1342)
^CSIGINT/SIGQUIT received...killing workers...
gateway "uWSGI http 1" has been buried (pid: 1342)
worker 1 buried after 1 seconds
goodbye to uWSGI.
(Tryton) root@host [/opt/Tryton]#

Maybe it doens't matter, but it seems odd that it's running 
/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules/__init__.py
 instead of /opt/Tryton/trytond-4.4.4/trytond/modules/__init__.py.

Regards,
Paul

-- 
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/8c27477f-db15-4197-8253-6a6a0b12a88f%40googlegroups.com.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Cédric Krier
On 2017-10-25 13:47, Richard PALO wrote:
> I believe there should be some additional things to consider, typically for 
> suppliers
> where instead of communicating net prices to their [professional] clients, 
> there are:

We don't try to compute instead of the supplier because you do not know
how they compute and any way, it is not needed. The current supplier
price list per quantity is good enough for approximation.

> 1. Fixed reductions : typically by category of product. (e.g. public price - 
> 50%)

Supported by sale_promotion

> 2. Compound reductions : e.g. 35% + 15% => (public price * (100%-35%)) * 
> (100%-15%)

Supported by price list

> 3. There may be as well volume discounts (in absence of a different article 
> reference number)

Supported by sale_promotion

> 4. I understand there may be fixed price reductions too (that is, not a 
> percentage) in the
> currency used, e.g. 1€ (or 1£ or 1€) or what have you...

Also supported by price list and sale_promotion even if it is highly
doubtable because of the currency.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@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/20171025115755.GX3623%40kei.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Richard PALO

Le 25/10/2017 à 10:43, Cédric Krier a écrit :

On 2017-10-24 08:29, Gonzalo wrote:

The problem is complex, I will try to explain it the best I can.
We are trying to use Tryton + GNU Health for a clinic. The clinic has
a kind of subscription/insurance where you paid an amount per month
and you get an amount of services to use (for example, 3 medical
consultation free...).
So should be able to know the amount of this products/services uses by
a person in the last month, and the price will depend on this.

To make things more complicated, the subscription can be per family
too, i.e., if your son uses the total of medical consultation that you
had free, you will have to pay.

I tried to use price_list but I don't understand how it works. Anyway,
I think you can’t consider the historic with that.


No price list is really not the right solution.

I think you should automatically append to the invoices deduction line
with negative line for each product that is eligible for the deduction.



I believe there should be some additional things to consider, typically for 
suppliers
where instead of communicating net prices to their [professional] clients, 
there are:
1. Fixed reductions : typically by category of product. (e.g. public price - 
50%)
2. Compound reductions : e.g. 35% + 15% => (public price * (100%-35%)) * 
(100%-15%)
3. There may be as well volume discounts (in absence of a different article 
reference number)
4. I understand there may be fixed price reductions too (that is, not a 
percentage) in the
currency used, e.g. 1€ (or 1£ or 1€) or what have you...

In these cases, the public list price is communicated when updated, as are the
reduction coefficients, according to what is negotiated.

There is, therefore, an impact on the price list... Naturally a broker may have 
this
on both supplier and client price lists. It seems that currently the pricing 
and price list
schemas don't deal with these common practices.

cheers,
--

Richard PALO

--
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/635d2cf3-7233-bfcc-9c1e-fc368b1c79c3%40free.fr.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Cédric Krier
On 2017-10-25 10:30, Sergi Almacellas Abellana wrote:
> El 24/10/17 a les 17:29, Gonzalo ha escrit:
> > So should be able to know the amount of this products/services uses by a 
> > person in the last month, and the price will depend on this. >
> The sale_promotion [2] module can be used to generate a promotion on the 
> sales. One option is to generate a promotion code on each subscription 
> consumption. Subscription codes can be filled by on_change when setting 
> the party.

Promotion will not ensure that it applies only for the quantity per
month of each products.

> > To make things more complicated, the subscription can be per family too, 
> > i.e., if your son uses the total of medical consultation that you had free, 
> > you will have to pay.
> > 
> That will be a fact of only selecting the promotion, when used by one of 
> the members of the familty.

Indeed I think the subscription should be linked to the sale and invoice
to know what to apply.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@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/20171025085356.GV3623%40kei.


Re: [tryton] uWSGI: can't find trytond.application.app

2017-10-25 Thread Cédric Krier
On 2017-10-24 13:00, PMan wrote:
> Python version: 3.6.2 (default, Aug  5 2017, 01:12:58)  [GCC 4.8.5 20150623 
> (Red Hat 4.8.5-11)]
> PEP 405 virtualenv detected: /opt/Tryton
> Set PythonHome to /opt/Tryton
> *** Python threads support is disabled. You can enable it with 
> --enable-threads ***

It seems you do not have thread on your Python. Tryton uses threading
module. I do not know if it may be the problem.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@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/20171025084920.GU3623%40kei.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Cédric Krier
On 2017-10-24 08:29, Gonzalo wrote:
> The problem is complex, I will try to explain it the best I can.
> We are trying to use Tryton + GNU Health for a clinic. The clinic has
> a kind of subscription/insurance where you paid an amount per month
> and you get an amount of services to use (for example, 3 medical
> consultation free...).
> So should be able to know the amount of this products/services uses by
> a person in the last month, and the price will depend on this.
> 
> To make things more complicated, the subscription can be per family
> too, i.e., if your son uses the total of medical consultation that you
> had free, you will have to pay.
> 
> I tried to use price_list but I don't understand how it works. Anyway,
> I think you can’t consider the historic with that.

No price list is really not the right solution.

I think you should automatically append to the invoices deduction line
with negative line for each product that is eligible for the deduction.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@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/20171025084331.GT3623%40kei.


Re: [tryton] Discount per family and per amount of products in a month

2017-10-25 Thread Sergi Almacellas Abellana

El 24/10/17 a les 17:29, Gonzalo ha escrit:

First, sorry for my english.

The problem is complex, I will try to explain it the best I can.
We are trying to use Tryton + GNU Health for a clinic. The clinic has a kind of 
subscription/insurance where you paid an amount per month and you get an amount 
of services to use (for example, 3 medical consultation free...).


The sale_subscription [1] module can be used to generate a montlhy 
invoice for invoicing the insurance.



So should be able to know the amount of this products/services uses by a person in 
the last month, and the price will depend on this. >
The sale_promotion [2] module can be used to generate a promotion on the 
sales. One option is to generate a promotion code on each subscription 
consumption. Subscription codes can be filled by on_change when setting 
the party.



To make things more complicated, the subscription can be per family too, i.e., 
if your son uses the total of medical consultation that you had free, you will 
have to pay.

That will be a fact of only selecting the promotion, when used by one of 
the members of the familty.


Hope it helps.

[1] http://doc.tryton.org/4.4/modules/sale_subscription/doc/index.html
[2] http://doc.tryton.org/4.4/modules/sale_promotion/doc/index.html


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/92d951b9-c655-16ba-63e4-ffe84bf3980b%40koolpi.com.