Re: NO_STOCK_CHECKOUT on a per-product basis

2013-02-11 Thread Dan Ionescu
Hello,
I have question that is kind of related with this topic, if you can help 
me. Can you please tell me if NO_STOCK_CHECKOUT=False is thread safe? 
Meaning, what happens if two costumers place an order with the sum of 
product quantities higher than the stock of the order, or something like 
that. I am new to django and python and from what I saw the 
decrease_inventory_on_sale is called on the order_success signal, which I 
am not sure whether they're thread safe or not. But aside from these 
signals if the function _set_quantity from satchmo_store.shop.views.cart 
is called at the same time from two simultaneous requests, the case with 
the two customers adding the same product with overflowing sum of 
quantities happens.

Thank you very much!

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to satchmo-users+unsubscr...@googlegroups.com.
To post to this group, send email to satchmo-users@googlegroups.com.
Visit this group at http://groups.google.com/group/satchmo-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: NO_STOCK_CHECKOUT on a per-product basis

2012-10-11 Thread Benjamin Hell
On Oct 11, 2012, at 06:05 , Laszlo Antal  wrote:
> On Oct 10, 2012, at 11:44, Benjamin Hell  wrote:
>> On Oct 8, 2012, at 18:51 , LZAntal  wrote:
>>> On Oct 8, 2012, at 9:29 AM, Benjamin Hell  wrote:
 Before I try to reinvent the wheel: Has anyone implemented a 
 NO_STOCK_CHECKOUT option for products or even product variations, i.e. the 
 possibility to allow for backordering certain products only?
>> 
> Oh I see. I miss read your previous email.
> Also done that. What it was is a qty limit  per customer. Created an app with 
> a qty field and a foreignkey tithe product.
> In the cart add veto signal checked against this table and just returned and 
> error or let it by. You could do the same but instead of qty limit just allow 
> the zero inv. checkout if its in that table.
> 
> Hope it helps

Yes, it does indeed! This signals based solution will end up on my to do list 
if nothing more appealing pops up.

Thanks!

Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to satchmo-users@googlegroups.com.
To unsubscribe from this group, send email to 
satchmo-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.



Re: NO_STOCK_CHECKOUT on a per-product basis

2012-10-10 Thread Laszlo Antal
Hi,

On Oct 10, 2012, at 11:44, Benjamin Hell  wrote:

> On Oct 8, 2012, at 18:51 , LZAntal  wrote:
>> On Oct 8, 2012, at 9:29 AM, Benjamin Hell  wrote:
>>> Before I try to reinvent the wheel: Has anyone implemented a 
>>> NO_STOCK_CHECKOUT option for products or even product variations, i.e. the 
>>> possibility to allow for backordering certain products only?
>> I implemented a backorder status for orders. I allow checkout with 0 
>> inventory and after checkout complete I attached to the signal to loop 
>> through the order and see if any of the products inventory below 0. If so I 
>> set the order status to backorder.
> 
> Hmm, sounds easy enough but does not really help: I don't need to know if an 
> order is held due to some backordered product. Instead if would be nice if 
> some products could not be put in the cart if not in stock, while others 
> could be added to the cart even if it results in a backorder situation.
> 
> Thanks anyways for the signals reminder ;-)
> 
Oh I see. I miss read your previous email.
Also done that. What it was is a qty limit  per customer. Created an app with a 
qty field and a foreignkey tithe product.
In the cart add veto signal checked against this table and just returned and 
error or let it by.
You could do the same but instead of qty limit just allow the zero inv. 
checkout if its in that table.

Hope it helps

Laszlo
http://twitter.com/LZAntal


> Ben
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Satchmo users" group.
> To post to this group, send email to satchmo-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> satchmo-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/satchmo-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to satchmo-users@googlegroups.com.
To unsubscribe from this group, send email to 
satchmo-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.



Re: NO_STOCK_CHECKOUT on a per-product basis

2012-10-10 Thread Benjamin Hell
On Oct 8, 2012, at 18:51 , LZAntal  wrote:
> On Oct 8, 2012, at 9:29 AM, Benjamin Hell  wrote:
>> Before I try to reinvent the wheel: Has anyone implemented a 
>> NO_STOCK_CHECKOUT option for products or even product variations, i.e. the 
>> possibility to allow for backordering certain products only?
> I implemented a backorder status for orders. I allow checkout with 0 
> inventory and after checkout complete I attached to the signal to loop 
> through the order and see if any of the products inventory below 0. If so I 
> set the order status to backorder.

Hmm, sounds easy enough but does not really help: I don't need to know if an 
order is held due to some backordered product. Instead if would be nice if some 
products could not be put in the cart if not in stock, while others could be 
added to the cart even if it results in a backorder situation.

Thanks anyways for the signals reminder ;-)

Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to satchmo-users@googlegroups.com.
To unsubscribe from this group, send email to 
satchmo-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.



Re: NO_STOCK_CHECKOUT on a per-product basis

2012-10-08 Thread LZAntal
Hi,

I implemented a backorder status for orders. I allow checkout with 0 inventory 
and after checkout complete I attached to the signal to loop through the order 
and see if any of the products inventory below 0. If so I set the order status 
to backorder.

Laszlo


On Oct 8, 2012, at 9:29 AM, Benjamin Hell  wrote:

> Hi!
> 
> Before I try to reinvent the wheel: Has anyone implemented a 
> NO_STOCK_CHECKOUT option for products or even product variations, i.e. the 
> possibility to allow for backordering certain products only? By default, with 
> the global option NO_STOCK_CHECKOUT=True, one can always order everything, 
> even if the inventory is zero. If NO_STOCK_CHECKOUT=False, it is not possible 
> to add any zero stock products to the cart. I would need to specify the 
> behavior on a per product scale.
> 
> Has anybody done this before, or do you have any hints as per how to proceed?
> 
> Thanks for any help!
> 
> Ben
> 
> 
> Background (why I think this is useful): We have suppliers where we can only 
> order certain products/colors/sizes once or twice a year. Such products or 
> product variations should be sold out when they are gone, i.e. no 
> backordering. With other suppliers/products there are no limitations 
> regarding small scale orders, making backorders completely feasible.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Satchmo users" group.
> To post to this group, send email to satchmo-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> satchmo-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/satchmo-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to satchmo-users@googlegroups.com.
To unsubscribe from this group, send email to 
satchmo-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.



NO_STOCK_CHECKOUT on a per-product basis

2012-10-08 Thread Benjamin Hell
Hi!

Before I try to reinvent the wheel: Has anyone implemented a NO_STOCK_CHECKOUT 
option for products or even product variations, i.e. the possibility to allow 
for backordering certain products only? By default, with the global option 
NO_STOCK_CHECKOUT=True, one can always order everything, even if the inventory 
is zero. If NO_STOCK_CHECKOUT=False, it is not possible to add any zero stock 
products to the cart. I would need to specify the behavior on a per product 
scale.

Has anybody done this before, or do you have any hints as per how to proceed?

Thanks for any help!

Ben


Background (why I think this is useful): We have suppliers where we can only 
order certain products/colors/sizes once or twice a year. Such products or 
product variations should be sold out when they are gone, i.e. no backordering. 
With other suppliers/products there are no limitations regarding small scale 
orders, making backorders completely feasible.

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to satchmo-users@googlegroups.com.
To unsubscribe from this group, send email to 
satchmo-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.