Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Added adapted order.shipping_method #2653

Closed

Conversation

luisramos0
Copy link
Contributor

@luisramos0 luisramos0 commented Sep 6, 2018

What? Why?

Begins 2009

WIP: This is the quick fix, it still needs cleaning up, docs and tests.

What should we test?

More specs fixed.

Release notes

Changelog Category: Fixed
Adapted to spree 2 multi shipments by adding adapted shipping method to order.

How is this related to the Spree upgrade?

This is part fo the spree upgrade.

HugsDaniel and others added 30 commits April 17, 2018 16:10
Although we don't know how big the fixes introduced between 2.0.4 and
2.0.13 are, jumping from roughly 1.3.99 to 2.0.13 seems too big of
a change to do in one go.

Unless more issues like this one come up that force us to upgrade to
a newer version I believe it's best to be conservative. You'll find an
in-depth explanation in
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Spree-2.0-upgrade#getting-to-version-204-

A previous effort was done to upgrade to v2.0.13 in
openfoodfoundation#2209
…pree-2.0.4

Upgrade Spree to 2.0.4 instead of 2.0.13
We encountered the bug that
spree/spree@3fd1535
fixes, which is needed to boot the app using Spree 2.0.4.

This stems from
openfoodfoundation#2236 (comment)
…spree-2.0.4

Use OFN's Spree fork of 2.0.4 to get fixes
…2.0-migrations

Apply spree 2.0 migrations
This factory has been merged into the base_product factory. Besides,
products no longer have on_hand attribute.
According to
spree/spree@5ef8dc6
"Backorders can be configured now as per stock location or stock item".
This ensures that Spree's shipping methods take into account the ones
the order's distributor uses.

This reimplements what `#available_to_order_with_distributor_check?`
used to do and it doesn't work with Spree 2.0.4.
`#available_to_order?` is gone in Spree 2.0 and our customization on top
of it went away with openfoodfoundation#2256.
This will fetch latest changes applied in the fork. It also changes the
Github organization we fetch it from. From now on we'll work there and
not in Coopdevs org.
…ee-fork-changes

Upgrade spree to point to 1c3dfc7fb
…nt-order-argument

Spree 2.0: Fix GET "/"
…bs_not_found_or_not_defined

Changed require syntax to fit jquery-ui-rails v<5.0
* master: (206 commits)
  embedded groups layout changes
  embedded groups initial test
  Allow html requests for OrderCycleController#update
  Move applicator calls to OrderCycleForm
  Refactor OrderCycleForm to make logic clearer
  Extract schedule syncing logic into OrderCycleForm
  Add basic specs for OrderCyclesController#create
  Add basic OrderCycleForm to handle create/update logic
  Remove unnecessary respond_to blocks from OrderCyclesController
  Include admin users as managers on new enterprises
  Remove obsolete goWithoutHashFragments
  Simplify Navigation.go, not preserving hash fragments
  Only show change warning for open order cycles
  Use a SubscriptionsCount query object to provide counts to IndexOrderCycleSerializer
  Preload subscription counts for serialization in order cycle collection actions
  Request the subscription count for change warning each time, don't cache
  Ask user to confirm oc date change for open order cycles with subsciptions
  Fix ordering of Gemfile.lock
  Add rack-rewrite to handle redirects
  Renames product bulk edit action to index
  ...
openfoodfoundation#2007

Spree 2.0.4 creates in-memory shipments for the payment step. That means
we don't need to create a shipment in that transition. This change
copies the checkout_flow from the Spree code, but leaves one last
customisation: removal of the confirm step.
openfoodfoundation@75ec77d
sauloperez and others added 26 commits July 25, 2018 13:52
…p-address-from-distributor

Refactor ship address from distributor
Since openfoodfoundation/spree#6 got merged, we
need the app to use the latest Spree fork revision to pick up those
changes.
…e-dash-dependency

[Spree Upgrade] Remove dependency to Dash and Jirafe
…e-2-0-4-version

[Spree upgrade] Update Gemfile.lock to fetch the latest revision
* master: (125 commits)
  Fix syntax error in GETTING_STARTED.md
  Fix syntax error in README.md
  Fix link syntax errors in REAME.md and GETTING_STARTED.md
  Style recently merged code
  Update gem i18n-js to pick up locale changes
  Fix embedded shopfront menu responsiveness
  Add communications links to README
  Fix script/setup by making it less clever
  Change import and reset logic to work with first page
  Move options to first page
  Fix wrong sort predicates in customer index
  Reset reverse when clicking another column to sort
  Move logic for toggling by column into SortOptions
  Generalize sorting through SortOptions service
  Remove unused sorting preferences in ColumnsCtrl
  Fix frontend sorting in "Bulk Order Management"
  Fix frontend sorting in "Customers" index
  Change sorting to be done in ascending order first
  Wrap rows in customer index with TBODY tag
  Update .rubocop_todo.yml
  ...
…e-from-simple-product-to-base-product

Reimplement Spree's simple_product in OFN factory
…m decorators. We need to make the scoping somewhere else in spree2, see openfoodfoundation#2559
…e_items and by allowing shipment decorator to allow no adjustments in the shipment
… order id in paramater order, order.number will fail. This is only seen in spree 2 because only spree 2 calls this method with order id. Bug introduced here: openfoodfoundation@32d2adc#diff-aa82d768109073ea8ad7858146630be4R9. Spree change introduced here: spree/spree@8d90ae1#diff-1e2ba31309f1f1abd2a4b626036d316fR94
…ethod). This way we rely on the correct spree base_mailer.from_address (that gets it from Spree::Config
…items_controller_spec_fix

Spree2 - Bulk line items controller spec fix
…e_items and by allowing shipment decorator to allow no adjustments in the shipment

Fixed 5 out of 7 tests in orders_and_fulfillments_report_spec by providing target_shipment in test line_items
Fixed 12 out of 44 broken tests in bulk_order_management_spec.rb by providing target_shipment in test line_items.” “The remaining 32 failing tests are now failing with the very common: undefined method on_hand= on Spree::Variant
Improved 1 test in reports_spec.rb by providing target_shipment in test line_items. Test now fails with undefined method Spree::Order.shipping_method
Fixed 9 tests in orders_controller_spec by providing target_shipment in test line_items
Fixed 4 tests in packing_report_spec.rb by providing target_shipment in test line_items. Failing tests are now failing with undefined product.on_hand? method
Fixed 8 tests in line_items_controller_spec by providing target_shipment in test line_items
Fixed 1 test in update_billable_periods_spec by providing target_shipment in test line_items
Fixed 4 tests in bulk_coop_report_spec by providing target_shipment in test line_items. The 2 failing tests are now failing with undefined product.on_hand? method
Improved 1 test in line_items_controller_spec by providing target_shipment in test line_items. Test is still failing with an unexpected method call
Fixed 1 test in order_and_distributor_report_spec by providing target_shipment in test line_items
In Spree 2, products don't have `on_hand` or `on_demand` any more. But
we always create a standard variant in an after-save hook which accepts
these values due to our backwards compatibility patch.
The variant factory supports only `on_hand` now.
…_test_line_items

Spree2 fix test line items
…e_mailer_dec_update

Spree 2 Upgrade - MailMethod - Delete outdated base_mailer_decorator.from_address
…e is equivalent after ofn PR#2589). Also refactored remaining order_mailer_decorator methods by extracting duplicated code.
…er_mailer_decorator_bug

Spree 2 Upgrade - MailMethod - Fixed bug on order_mailer_decorator (only visible in spree 2)
…-sept

Merging master into 2-0-stable (one month of commits in master)
@luisramos0
Copy link
Contributor Author

Closing, my mistake. Wrong target branch. Should have been 2-0-stable.

@luisramos0 luisramos0 closed this Sep 6, 2018
@sauloperez
Copy link
Contributor

You can change that using top right's Edit button

imageedit_2_7801444247

@luisramos0
Copy link
Contributor Author

yes! I found out later :-( thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants