Kristina Lim
2c279fd02d
Remove line item adjustments if line item deleted
2019-07-13 03:58:01 +10:00
luisramos0
86b0d71c7e
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
2019-05-28 12:57:29 +01:00
luisramos0
527cfc1601
Merge branch 'master' into 2-0-stable-Mar29
2019-03-29 13:48:49 +00:00
Kristina Lim
79d0b63069
Add Spree::Address#full_name_reverse
2019-03-25 07:46:31 +08:00
luisramos0
b325cea6cb
Merge branch 'master' into 2-0-stable-Mar6
2019-03-06 09:19:53 +00:00
Maikel Linke
958e98debd
Document stock validation of variant overrides
2019-02-28 12:21:26 +11:00
luisramos0
12eab1bfa9
Merge variant_stock.count_on_hand into variant_stock.on_hand
...
variant.on_hand will not return infinity any longer if variant.on_demand is true. Clients of these methods will have to handle the combinations between on_hand and on_demand values
2019-02-18 22:00:16 +00:00
Luis Ramos
dd44d6a0ca
Merge pull request #3355 from luisramos0/2-0-pord-importer-spec
...
[Spree Upgrade] Phase 2 - Fix product_importer spec
2019-02-11 15:28:47 +00:00
luisramos0
e584fd2155
Make in_stock? work for both variants and overrides by moving it from VariantStock to variant_decorator.
...
Added tests for it in scope_hub_to_variant and improved VO shopping specs
2019-02-01 16:18:09 +00:00
luisramos0
2ffc5305d7
Adapted VariantStock to handle on_hand string values (product import is set on_hand with string values)
2019-01-29 14:55:18 +00:00
Pau Perez
a99a4725c9
Add #shipment to conform to OFN's decision
...
This ensures we can still use Order#shipment although Spree deprecates
it, while fixing a bug at the same time. The problem that was making the
test fail was on `Order#shipment` that Spree defines.
If the shipments association changes, `#shipment` returns stale data.
That is because the order object we might be using is still alive, and
so its @shipment ivar still holds an old shipment object (it's not nil)
and thus `@shipment ||= shipments.last` doesn't evaluate the right-hand
side of the expression.
Note that we need to `prepend` the evaluation of the concern (which it's
been rename) for our methods to take precedence over Spree ones. With
`include`, Spree's `#shipment` would still be picked up making the test
fail.
2019-01-18 16:02:51 +01:00
luisramos0
e28f9a7c84
Merge branch 'master' into 2-0-stable-jan-8th
2019-01-08 14:29:50 +00:00
luisramos0
6c70998b64
Move StockLocation.fill_status to VariantStock so we can easily override it
2018-12-21 11:33:07 +00:00
luisramos0
17ced61b3d
Override Spree::Variant.in_stock? in VariantStock so that we don’t depend on Spree::Stock::Quantifier
2018-12-21 11:33:07 +00:00
luisramos0
d641705053
Add variant scoping to availability_validator_decorator by using line_item.scoper and moving Spree::Stock::Quantifier.can_supply? to VariantStock so that it becomes overridable
2018-12-21 11:33:07 +00:00
luisramos0
66e69edca4
Rename ProductOnDemand to ProductStock; move product.on_hand into it; add product.on_demand; and remove unnecessary on_demand=
2018-12-12 12:10:25 +00:00
Maikel
d63ae792b3
Merge pull request #2775 from luisramos0/2-0-checkout-ship-method
...
[Spree Upgrade] Handle shipping_method_id in checkout
2018-12-11 11:59:03 +11:00
luisramos0
4f4fc00549
Improve code, specs and comments in the shipping_method selection process in the checkout controller
2018-12-09 20:05:10 +00:00
Kristina Lim
c873a7b8e3
Move stock settings override validation to concern
2018-12-09 23:29:36 +08:00
luisramos0
02d0b7e88c
Improve comment on VariantStock#move
2018-12-04 15:25:38 +00:00
luisramos0
e23c4dda68
Add order_shipping_method specs to cover select_shipping_method
2018-11-30 12:58:27 +00:00
luisramos0
7a8c65b3ea
In the checkout controller update process, grab shipping_method_id from form data and inject it in the order when the order workflow gets to delivery (which is when the order gets shipments created)
2018-11-30 10:46:31 +00:00
luisramos0
6156aca467
Delegate stock_location.move to variant, and override it in the variant overrides scope
2018-11-29 19:32:52 +00:00
luisramos0
f509fa6c86
Make variantStock.on_demand= save the variant so that it doesn't impact on_hand that is already saving the variant with a lock
2018-11-23 18:07:08 +00:00
luisramos0
ba8aa110c2
Fix VariantStock.overwrite_stock_levels by using stock_item.adjust_count_on_hand. This makes product_controller_decorator.bulk_update work
2018-11-23 18:06:48 +00:00
luisramos0
6cdaaa9e7d
Add VariantStock.on_demand as attribute_accessible so it can be mass assigned from product_controller_decorator.bulk_update
2018-11-23 12:04:00 +00:00
luisramos0
134b73d730
Improve VariantStock code by extracting stockitems.first to a separate method
2018-11-22 20:38:46 +00:00
luisramos0
bf32a21155
Allow adapted on_hand attr to be mass assigned in VariantStock.
...
Without specifying it in `attr_accessible`, `#assign_attributes` won't
work. See details in
https://apidock.com/rails/v3.2.13/ActiveRecord/Persistence/update_attributes
and https://apidock.com/rails/ActiveRecord/Base/assign_attributes .
2018-11-19 10:05:17 +00:00
Pau Perez
de31823151
Add #on_demand= to make product creation page work
...
We're bringing in the setter that got removed in Spree 2.0 so that we
can still pass an on_demand value from the product creation form.
However, we won't keep the getter to keep things simple. The frontend
seems to be checking the existence of variants anyway, so then it can
also check for product.master.on_demand and we avoid some logic on the
backend.
2018-11-08 11:41:58 +00:00
Pau Pérez Fabregat
99ba9d7d1b
Merge branch '2-0-stable' into unit-test-variant-stock
2018-09-19 15:41:21 +02:00
Pau Perez
0491a96d44
Ask to use backorderable? instead of on_demand
2018-09-19 15:12:38 +02:00
Pau Perez
314ad5400f
Move variant_stock.rb to concerns/
2018-09-18 12:18:50 +02:00
luisramos0
3577f3790d
Moved order.shipping_method to the OrderShippingMethod concern
2018-09-11 00:24:35 +01:00