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

2017-10-27 Thread Richard PALO

Le 28/10/2017 à 01:12, Cédric Krier a écrit :

On 2017-10-27 22:27, Richard PALO wrote:

So do not fill it. You do not need to have the supplier price, it is
there for information.



?? I thought that stock receptions used the order prices (not the invoiced 
price) for stock
valuation on the stock move. Has this changed, or do I misunderstand the 
workflow?
That is, it is frequent here to have invoices based upon [one or more] 
deliveries.


You should know the price of the product when you validated the
quotation and at worst when you receive the goods so you can update the
price on the move.



Indeed, that is my point.

With respect to promotions, sale_promotion is only for sales and not purchases.
It seems that it should be neutral, but I imagine you suggest in this case that
a purchase_promotion module be devised
--

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/b9289fd0-0c4d-a2eb-29c7-1324702fbb29%40free.fr.


Re: [tryton-dev] Order application of domain clause

2017-10-27 Thread Cédric Krier
On 2017-10-27 06:35, Thierry Bruyere wrote:
> Is it possible to apply this type of search by domain by forcing the order of 
> domain clauses
> and so limiting the number of items involved in quantity calculation?

No, each clause is evaluated one by one individually. What may happen is
when the clause evaluation result is a SQL query then the database may
perform optimization by using a specific query plan.

If this is really a performance killer, you may create a custom function
field which implement a searcher that compose many clause together. In
your case, it will reproduce the _search_quantity but on the desired
subset of products.

-- 
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-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20171027232037.GB6037%40kei.


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

2017-10-27 Thread Cédric Krier
On 2017-10-27 22:27, Richard PALO wrote:
> > So do not fill it. You do not need to have the supplier price, it is
> > there for information.
> > 
> 
> ?? I thought that stock receptions used the order prices (not the invoiced 
> price) for stock
> valuation on the stock move. Has this changed, or do I misunderstand the 
> workflow?
> That is, it is frequent here to have invoices based upon [one or more] 
> deliveries.

You should know the price of the product when you validated the
quotation and at worst when you receive the goods so you can update the
price on the move.

-- 
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/20171027231248.GA6037%40kei.


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

2017-10-27 Thread Richard PALO

Le 26/10/2017 à 10:09, Cédric Krier a écrit :

On 2017-10-26 07:19, Richard PALO wrote:

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.


You can not compute in place of the supplier because you will compute
wrong. Also supplier will mostly never tell you what computation they
do.



Well, I guess we disagree on this point. A 'sale' is an *agreement* on the 
'price' of *the* 'article'.
Frequently the supplier agreement is based on such a formula as mentioned prior.


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.


No sale promotion are not necessary limited in time. The start/end date
are optional.



What I meant is that a sale 'promotion' is over and above the habitual supplier 
agreement,
and that the existing invoice reduction scheme seems to handle this okay.


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.


No price list are not for supplier on purpose.


(though I wonder if the patches for issue3797 may cause any problem
here?)


Already manage: 
https://codereview.tryton.org/40731002/diff/60001/purchase.py#newcode1139


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'.


Now if you really want it you can create a custom module
purchase_price_list, it will be very easy to implement.



Ah, this is indeed the issue I encounter I guess :-(
Will need to do this asap!


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.


So do not fill it. You do not need to have the supplier price, it is
there for information.



?? I thought that stock receptions used the order prices (not the invoiced 
price) for stock
valuation on the stock move. Has this changed, or do I misunderstand the 
workflow?
That is, it is frequent here to have invoices based upon [one or more] 
deliveries.


--

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/4c7c5faa-f94d-80cd-ff97-dec29f551215%40free.fr.


[tryton-dev] Order application of domain clause

2017-10-27 Thread Thierry Bruyere
We wanted to make a list of our products with zero stock for a specific process 
in our job.
For this purpose we have defined a context to include all the "locations" of 
type "storage".
Then we launch a search on the model product with a domain.

Example:

class Product:
__metaclass__ = PoolMeta
__name__ = 'product.product'

...

@classmethod
def check_qty(cls):
pool = Pool()
Date = pool.get('ir.date')
Stock = pool.get('stock.location')
locations = Stock.search([('type', '=', 'storage')])
stock_date_end = Date.today()

domain = [
('type', '=', 'goods'),
('quantity', '=', 0.0),
]

with Transaction().set_context(locations=[l.id for l in locations],
stock_date_end=stock_date_end):
products = cls.search(domain)
...


With this method, we found that the system first calculates the quantity for 
all products without
using our first domain clause which limits the number of items to be processed.

To simplify the example we have defined a search on' Goods' type products
but in our case we work with other parameters.

Is it possible to apply this type of search by domain by forcing the order of 
domain clauses
and so limiting the number of items involved in quantity calculation?

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/bc8d9db3-d0cb-4883-871f-4f961116188f%40googlegroups.com.


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

2017-10-27 Thread Sergi Almacellas Abellana

El 26/10/17 a les 22:49, PMan ha escrit:

Here is the tryton.ini file (with threads enabled):

[uwsgi]
uid = user
gid = group
master = True # start in master mode
http-socket = 127.0.0.1:8000
# bind to port 8000
enable-threads = true
workers = 1
threads = 2

virtualenv = /opt/Tryton
# chdir = /opt/Tryton/trytond-4.4.4/trytond
module = trytond.application.app
env = TRYTOND_CONFIG = /opt/Tryton/etc/trytond.conf

I tried this with the chdir command commented and uncommented, I got the same 
results.


For me it seems that trytond is not properly installed on the virtualenv 
(and that's why it's not found)


How you installed it? Are you sure you've created the virtualenv in 
/opt/Tryton ?



--
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/8dfb6b68-627d-0017-1d30-5aca6af3d7db%40koolpi.com.