Commit Graph

791 Commits

Author SHA1 Message Date
luisramos0
0a77eeb4b6 Merge branch 'master' into 2-0-stable-nov-14th 2018-11-14 11:35:58 +00:00
Pau Pérez Fabregat
e66f406ea6 Merge pull request #2946 from luisramos0/improve_taxons
Sort Product categories alphabetically by name
2018-11-14 11:23:59 +01:00
Maikel
57efc36448 Merge pull request #2993 from Matt-Yorkley/user_class
Deal with failing Spree::LegacyUser test
2018-11-09 10:21:31 +11:00
luisramos0
fcdb5cd7af Merge branch 'master' into 2-0-stable-nov-8th 2018-11-08 11:18:54 +00:00
Matt-Yorkley
8aa6b2c0ac Stub spree_api_key on Spree::LegacyUser when signing in as regular user 2018-11-08 00:07:24 +00:00
Hugo Daniel
bc9af7c45f Add an API key for admin user 2018-11-07 16:47:35 +01:00
luisramos0
9490da329a Move Calculator::Weight from models/open_food_network/calculator to models/calculator 2018-11-07 09:54:30 +00:00
luisramos0
3d106d749b Fix rubocop warnings on load_sample_data task 2018-10-30 18:00:52 +00:00
luisramos0
82befd945b Sort Product categories alphabetically by name and fixsample data by fixing taxons taxonomy id 2018-10-30 18:00:48 +00:00
Maikel
01c21c302c Merge pull request #2811 from luisramos0/2-0-adjust-basic-spec-fix
[Spree Upgrade] Fixes shipping tests in adjustment spec
2018-10-18 14:49:28 +11:00
Pau Pérez Fabregat
601e0b927a Merge pull request #2816 from luisramos0/2-0-adjust-enterprise-fees-spec-fix-aplicator
[Spree Upgrade] Fix enterprise fees specs in adjustment_spec - enterprise_fee_aplicator
2018-10-16 19:47:10 +02:00
Luis Ramos
3e4f92fe92 Merge branch '2-0-stable' into 2-0-adjust-basic-spec-fix 2018-10-16 17:33:33 +01:00
luisramos0
87cd73ddba Merge branch 'master' into 2-0-stable-oct 2018-10-15 17:09:26 +01:00
Pau Perez
a5a2cb8ea7 Revert "Merge pull request #2856 from luisramos0/2-0-adjust-clean-up"
This reverts commit fa689b6607, reversing
changes made to 2aeed9763c.
2018-10-15 15:48:48 +02:00
luisramos0
4380ff7bd7 Drop calculated_adjustments_decorator. This file was introduced in ofn's a0b740f52d. The change is already in spree 2.0.4, see here 2c82aab566 (diff-00aa4190da81ca29804a406252f1d0f4) 2018-10-12 23:09:36 +01:00
luisramos0
8b0726b815 Fix enterprise fee calculation. The adjustment.source value of the fee is now allowing the inheritance of the tax category from line items 2018-10-11 23:02:17 +01:00
luisramos0
8aee0f9438 Reorganize code in EnterpriseFeeApplicator 2018-10-11 23:02:17 +01:00
luisramos0
dcf0eefe04 Drop calculated_adjustments_decorator. This file was introduced in ofn's a0b740f52d. The change is already in spree 2.0.4, see here 2c82aab566 (diff-00aa4190da81ca29804a406252f1d0f4) 2018-10-11 17:16:58 +01:00
luisramos0
8a22567291 Fix enterprise fee calculation. The adjustment.source value of the fee is now allowing the inheritance of the tax category from line items 2018-10-02 23:44:38 +01:00
luisramos0
1ce431b671 Reorganize code in EnterpriseFeeApplicator 2018-10-02 23:39:31 +01:00
Maikel Linke
9dcc683dc0 Notify Bugsnag on sign-up errors
This may lead to more error reports than we want to see. A not existing
email address may cause Bugsnag to be notified. If this happens, we can
rescue form these specific errors and only report the rest.
2018-09-27 13:33:09 +10:00
Pau Perez
4a7ee9b91e Remove no longer used rake task 2018-09-24 17:17:10 +02:00
Luis Ramos
08104c62be Merge pull request #2667 from luisramos0/2-0-ship-method-last-used-address
[Spree Upgrade] Adapt Address_Finder.last_used_ship_address to spree 2
2018-09-24 15:07:27 +01:00
Luis Ramos
0eb2854f8a Merge pull request #2680 from luisramos0/2-0-stable-x
[Spree Upgrade] Fixed inexistent order#shipping_method= in several specs
2018-09-24 15:07:04 +01:00
Pau Pérez Fabregat
20077c99b5 Merge pull request #2618 from coopdevs/enable-style-send-cop
Favor #public_send over #send using Rubocop's cop
2018-09-20 19:03:40 +02: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
314ad5400f Move variant_stock.rb to concerns/ 2018-09-18 12:18:50 +02:00
Maikel
19df4ff640 Merge pull request #2701 from mkllnk/2700-improve-product-refresh-scheduling
2700 improve product refresh scheduling
2018-09-18 12:09:24 +10:00
luisramos0
75656668cd Fixed query in order_cycle_management_report and fixed the respective spec by setting shipping_method in order through shipments 2018-09-17 00:51:01 +01:00
Maikel Linke
ac85b90315 Clarify private class method declaration 2018-09-15 10:18:54 +10:00
luisramos0
2da7cc00f8 Fixed Address Finder last_used_ship_address. It now uses order.shipments.shipping_methods instead of order.shipping_method 2018-09-14 16:43:20 +01:00
Maikel Linke
ec953e1db0 Style cache refreshment class 2018-09-13 17:22:01 +10:00
Maikel Linke
2e635f94f6 Make job queuing more robust and efficient 2018-09-13 17:20:11 +10:00
Maikel Linke
a447fe4f40 Require lib file where needed
We can't always rely on other parts of the code been loaded first. We
need to declare dependencies so that they are always present.

I just ran into this problem in my dev environment.
2018-09-13 12:01:16 +10:00
luisramos0
145b4385a4 Fixed db:load_sample_data shipping_method build 2018-09-11 22:21:43 +01:00
Pau Perez
8d8670bdf4 Fix typos in comments 2018-09-10 14:26:19 +02:00
Pau Perez
cd53ec1a4f Replace exception with DB uniqueness constraint
By forbidding more than a row per variant in the spree_stock_items we
can ensure all variants have a single stock_item associated.
2018-09-06 13:21:22 +02:00
Pau Perez
8848af15ee Raise when a variant has more than a stock item
This means we violated the business rules of having a single stock
location for the OFN instance and hence a single stock item per variant.

Although it is too late to preserve the data integrity we can know data
needs to be cleaned up.
2018-09-06 13:20:52 +02:00
Pau Perez
59883f9509 Add deprecation warnings for VariantStock methods
This will prevent other devs from relying on this methods and will tell
us the exact lines that call this methods, which will come in handy when
removing this module.
2018-09-06 13:20:52 +02:00
Pau Perez
fc5882686a Add unit tests to VariantStock
This also replaces the after_save callback to after_update.

We enforce a stock_item exists when modifying the variant and the
stock_item gets created on variant's after_create. This means it's not
possible to use any of the VariantStock's setters before the variant is
persisted so executing the callback on creation is pointless.
2018-09-06 13:20:52 +02:00
Kristina Lim
f9533f8fb8 Refactor redirecting back after requiring login 2018-09-06 19:46:17 +10:00
Pau Perez
b23cb55525 Fix current violations of Style/Send cop 2018-09-05 12:05:05 +02:00
luisramos0
89d51d75ae Merge branch 'master' into 2-0-stable-sept 2018-09-04 17:43:20 +01:00
Maikel Linke
c7648d67bd Add Variant stock API of Spree 1 2018-08-30 13:55:12 +10:00
Maikel Linke
9dcbd9076e Override in_stock? to prepare for Spree 2.0 2018-08-09 14:22:43 +10:00
Maikel Linke
b84e524f2d Prepare inventory report for Spree upgrade
This change could impact the performance of the report. But therefore it
takes VariantOverrides into consideration. The old code ignored the
distributor for this filter. It also ignored the `on_demand` flag.
2018-08-09 14:22:43 +10:00
Maikel Linke
289d0b937f Style ScopeVariantToHub 2018-08-09 14:22:43 +10:00
Rob Harrington
0afa9fae8e Check authorisation before attempting to charge credit cards on order cycle close 2018-07-05 19:26:12 +10:00
Rob Harrington
45895e9924 Use the user's default card to pay for subcriptions 2018-07-05 19:26:11 +10:00
Frank West
8324b00999 Renames product bulk edit action to index
When a user hit cancel while editing a product it took them to the spree
products index page instead of the bulk edit page. The button was part
of a shared view for all resources so changing it's actions were not
readily available.

It was suggested that instead of carrying our own separate controller
action we could just override the index action of the products
controller with the bulk edit functionality instead. This has the
advantage of removing some overrides and allows us to not add
additional overrides in the future.
2018-06-19 17:51:23 +10:00