Skip to content

[18.0][MIG] connector_ecommerce: Migration to 18.0 (based on bank payment alternative)#83

Closed
vvrossem wants to merge 86 commits intoOCA:18.0from
camptocamp:18.0-mig-connector_ecommerce
Closed

[18.0][MIG] connector_ecommerce: Migration to 18.0 (based on bank payment alternative)#83
vvrossem wants to merge 86 commits intoOCA:18.0from
camptocamp:18.0-mig-connector_ecommerce

Conversation

@vvrossem
Copy link

@vvrossem vvrossem commented Feb 12, 2025

[MIG][17.0] connector_ecommerce: Migration to 17.0 used as source

Removed dependencies:

  • sale_automatic_workflow_payment_mode (glue module of sale_automatic_workflow and account_payment_sale), to use account_payment_sale only

Missing dependencies:

Guewen Baconnier and others added 30 commits February 12, 2025 10:27
[FIX] decimal_precision import does not use openerp.addons namespace
[FIX] remove an old view not installable
[IMP] finish onchange support, add doc string, support tax. The option use external taxe will be not implemented, as re-computing tax in OpenERP is the best option. If you need it, create a independant module for it, fix copyright

[REF] refactor introduce the class SaleOrderOnChange
…ork, + support adding extra s.o. lines on the fly

add comments on the internals of SaleOrderOnChange.play()
[IMP] work on stock.picking.out instead of stock.picking

[REM] clean delivery carrier old code

[ADD] a connector hook in the stock.picking.out view

[FIX] action_done is not called on stock.picking.out but only on stock.picking

[CHG] rename base_sale_data.xml to ecommerce_data.xml

[ADD] hook in invoice view for connectors

[ADD] account_invoice.origin_order_id, link to the order which created the invoice

[REF] moved sale.py code to old_stuff.py

[ADD] copy the order id to the invoice it creates

[REM] remove code

[REF] move content of partner.py to old_stuff.py

[REF] move partner_view.xml content to old_xml_stuff.xml

[REF] moved code from product.py to old_stuff.py

[REF] removed views and act_window links to ir.model.data from sale_view.xml

[REF] removed external.referential.category.csv

[REF] remove obsolete access groups

[REF] comment out the sale exception until its reimplementation

[REF] removed the import order wizard

[REF] removed connector.py

[FIX] style

[REF] moved external_referential.py code to old_stuff.py

[REF] remove empty files

[ADD] hook for connectors in sale view

[FIX] do not load removed file

[REF] updated __openerp__ manifest, changed copyright attribution to reflect the facts, changed the license from GPL to AGPL-3

[FIX] reintroduce methods used for the import of magento sale orders

[FIX] connector_ecommerce: replace dependencies on sale_quick_payment by sale_quick_payment

[ADD] connector_ecommerce: add import_rule and days_before_cancel in payment.method, theses fields will be used by the connectors

[IMP] connector_ecommerce: call the onchanges on the sale order to apply the workflow default values

[IMP] connector_ecommerce: activate the options 'Allow different addresses', 'Multiple shop', 'Discount on SO lines'

[FIX] noupdate=1 on the global settings activation

[FIX] missing name in a view

[IMP] add hints in payment method view to help in the choice of the import rules

[ADD] on_product_price_changed Event, fired when the price of a product could have changed

As the price is a fields.function based on the contextual pricelist, we can never be sure
that a price has changed, it depends on the context.

So we search all the base fields used to compute the price, and if one of these has changed,
the event is fired.

[FIX] initialize the context when None

[IMP] reviewed the connector_ecommerce's description in the manifest __openerp__.py

[FIX] remove obsolete sale exception

[ADD] fields cancelled_in_backend and cancellation_resolved to handle the cancellation of the sales orders from a backend

[IMP] add a notification when a user choose to not cancel a sales order cancelled on the backend

[ADD] notification when a sales order is cancelled on the backend

[IMP] ignore the cancellation from the backend should be done by a sales manager only

[IMP] ask for a reason when the sale order is not cancelled despite the cancellation on the backend

[FIX] filter on cancels should exclude the resolved cancels

[ADD] a parent_id field on the sale order, base implementation, the logic needs to be implemented in the connectors due to their own specificities

[ADD] button to open the parent sale order

[ADD] sale exception preventing confirmation of a sale order when it has a parent order cancelled on the backend

[IMP] add the sales manager rights to the connector manager because they usually need these rights

[IMP] fields 'need_cancel' and 'parent_need_cancel'

[FIX] spells cancelled with the US form: canceled

[FIX] typos in views

[FIX] hide the 'keep open' button in canceled state

[ADD] when we write 'canceled_in_backend' in a sales order, try to automatically cancel it

[FIX] filter out already cancelled sales orders from the filter 'to cancel'

[FIX] domain for the invisible attribute of the 'keep open' button, logic was reversed

[IMP] add a note on the related pickings and invoices of an order cancelled from backend

[FIX] cancelation of sales order: quotation states requires to be canceled via the workflow, sales order states with the action_cancel method. Some states can not be canceled.

[ADD] sale exception when an ordered product has a pending connector checkpoint

[ADD] french translation
…horized by a payment institute but not paid yet.
… orders (shipping, ...), need a refactoring of the Mapper though. WIP
…ne for prestashoperpconnect in a first place to be able to add or not the tax on delivery lines)
[ADD] a test which check if on_invoice_validated is correctly fired

[ADD] test the fire of 'on_invoice_paid'

[FIX] formatting of the onchange test

[FIX] fix the failing test: the payment_method_id and workflow_payment_id are not mandatory in a sale order

[FIX] fr_FR.po files not loaded, should be named fr.po

[FIX] context not propagated

[ADD] docstring

[CHG] rename ExtraOrderLineBuilder to SpecialOrderLineBuilder

[FIX] use session

[ADD] deprecation warning

[IMP] allow to use a product id or a product browse_record in lines builders

[FIX] Sales Orders onchanges: allow to have lines with other commands than (0, 0, {values}).

[FIX] simplify last change

[FIX] in lines builders, product_ref is not mandatory if we provide a product, renames 'product_id' to 'product', keeping ambiguity as we can have an int or browse_record.

[IMP] propagate the 'shop_id' in the context if it exists so the fiscal position rules (from openerp-fiscal-rules' project) can apply automatically

[FIX] 'int' object is not iterable error

[FIX] 'int' object is not iterable error, again
…ity by default so they are likely to appear at the bottom, shipping line being the last one
…d in case of orders with many lines, leave some space if people want to insert custom special lines in between

The default special's sequence is 980, for the same reason than before

do not build a new dict when default is an empty dict, not necessary to build a context dict (not used)

add read accesses on the sales users so they can confirm a sales order
Move connector_ecommerce in the root folder and set installable

It now depends on sale_payment_automatic_workflow

In v7. sale_automatic_workflow had a dependency on sale_payment_method.
This is no longer true, now the module sale_payment_automatic_workflow
makes the glue between sale_automatic_workflow and sale_payment_method.

sale.shop has passed away

Remove the deprecated methods used to generate special lines, yeah!

stock.picking.out is no longer there

Remove the fiscal position rule onchange

As something similar has been implemented in v8, I'm not sure that
the fiscal position rule will be used and if it will, the onchange signature
will change, so let's remove it and add it again if necessary later.

Adapt the onchange players to the new API

Thanks to Model.onchange(), we apply the onchanges on a temporary 'new record' and get back the changed values.
Then we apply these values on our order values.

Use relative imports and remove fast_suite, checks in tests

Use the new env when building special lines

Rename environment to connector_env (follows connector's changes)

Use the new API

Correctly raise the event when a picking becomes 'done'

Test that on_tracking_number_added is fired

Correctly fire the event for partial pickings

Update the manifest and description; bump to 3.0.0

Correction of typos

Use @api.one as we have nothing outside the loop

Corrections of more typos
@gurneyalex
Copy link
Member

Hello @vvrossem
We would like to split out the dependency on sale automatic workflow from the connector_ecommerce in 18.0. Do you think this would cause issues (for instance if the code for this is tightly coupled inside the module)?

@vvrossem vvrossem force-pushed the 18.0-mig-connector_ecommerce branch 4 times, most recently from a0d8553 to 80fde91 Compare February 25, 2025 14:59
default="always",
required=True,
help="""
- Never: the sales orders using the payment method will never be imported.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we have anything for "Authorized"?

>
<group>
<field name="canceled_in_backend" />
<field name="cancellation_resolved" invisible="1" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0
If the module brings from past versions fields in the views as invisible because they are used in expressions (invisible, column_invisible, readonly, required, context, domain) of other fields, you can now remove them for cleanliness, as they are auto-added. See more info at odoo/odoo#137031.

Copy link

@yankinmax yankinmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

_inherit = "account.payment.method"

@api.model
def _get_payment_method_domain(self, payment_method):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leemannd
Copy link

Warning: you depend on a module that is not merged. It has been superseeded by -> OCA/bank-payment#1447
And the two PRs have huge changes.

@leemannd
Copy link

leemannd commented May 15, 2025

Warning The module account_payment_sale has been merged into a version we don't want.
It will be moved to -> https://github.com/OCA/bank-payment-alternative
Please don't take in account the module that is currently merged into the branch 18.0.

We have a temporary PR -> OCA/bank-payment-alternative#1

To keep track of the work done. We may want to change the module name (not done for the moment).

@yankinmax yankinmax force-pushed the 18.0-mig-connector_ecommerce branch from 6c23ff8 to e4652d4 Compare June 10, 2025 12:44
@LoisRForgeFlow
Copy link

@leemannd FWIW based on the naming mapping provided by Alexis:

image

account_payment_sale will still remain on the main/original repository, and will have a different name (account_payment_base_oca_sale) in the alternative. Shouldn't you open the migration on the original repo?

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module should stay in the original OCA/bank-payment suite. If you want a different version, you should fork also this module.

@leemannd
Copy link

leemannd commented Jun 24, 2025

Hello @LoisRForgeFlow @pedrobaeza , Thank you for your inputs.

We will recheck the naming with what has been merged into the repository bank-payment-alternative.

We want to use the module e-commerce and bank-payment-alternative. Unless you have a better proposition, my understanding is that we need to do the same and ask for the creation of a new repository connector-ecommerce-alternative ?

I'm not sure I like this idea and I'm afraid that it will land in the creation of several repositories *-alternative. There is some coherence in it but it feels like it is a bit too much a "fork-war" and my concern is about loosing a global consistency inbetween the OCA repositories/modules.

Unless you have a better input/idea, we will do so.

Rebel modules are only for testing? AFAIR we don't have the possibility to exclude the installation of incompatibles modules.
If we had this possibility. I would love to keep two versions of the e-commercemodule into the same repository.

@rvalyi
Copy link
Member

rvalyi commented Jun 24, 2025

This kind of situation certainly sucks... Eventually we might create a third interface account_payment_order module that would kind of abstract away the basic features of the two alternative modules without having a hard dependency on them. This kind of thing has never been done in the OCA and it would certainly be challenging regarding the ORM/framework support and what common features could really be abstracted away in a robust manner. I'm not telling this is the solution here, but eventually such eventualities of modules forks may happen again (while it should be avoided at all costs) and eventually this is something we might need to deal with.

So for instance here is how Debian deals with such situations (though the surface of such interfaces is probably much smaller in the Debian case): https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%5B%2215Sh_xjfl_PkB6wlFScAvqmdyIsQboXvL%22%5D,%22action%22:%22open%22,%22userId%22:%22114418078122921323275%22,%22resourceKeys%22:%7B%7D%7D&usp=sharing
cc @pedrobaeza @sbidoul

@pedrobaeza
Copy link
Member

Well, the solution is that you come back to sanity and remove the fork, and let's do everything to converge. We are still opened to try solutions, as stated everywhere. If not, doing "interfaces" is only a patch over a patch over a patch...

@hparfr
Copy link

hparfr commented Jun 25, 2025

This kind of thing has never been done in the OCA

What about https://github.com/OCA/search-engine/tree/16.0/connector_search_engine since v10 ?

@sebastienbeau
Copy link
Member

@leemannd just to understand your need of moving to bank-alternative.

If am right you do not use Alexis payment order module right ?
You use Enterprise one ? And your purpose here is to

  • have the configuration on "account.payment.method.line" (native odoo)
  • fill the "preferred_payment_method_line_id'" of the account.move from the sale order
    so it's more compatible with enterprise, right ? This is why you want to depend on "account_payment_base_oca"

I may have a idea that can avoid a fork here, but before developing the idea, I would like to be sure understand the need.

Thanks for your feedback.

@leemannd
Copy link

Hello @alexis-via , You're correct in your assumptions.

@flotho
Copy link
Member

flotho commented Aug 18, 2025

Hi @leemannd ,

coul you elaborate your latest answer ? What is the maturity of this PR?
Regards

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvrossem @leemannd let's discuss about the internal solution.
For sure, we don't want the proliferation of *-alternative repositories.
We've discussed at the OCA days and we have a - kind of - clear picture of what's next.
I'll drop a comment on bank-payment-alternative issue.

@leemannd
Copy link

Hello @simahawk , can you please ping me when you have the message with the clear picture. We are currently in production with it and I'm not fond in "changing" too much what we did.
It may cost too much for us given the time we already lost due to the disagreements on this topic.

I'm looking forward for the resolution. But for the moment I may have a strong opinion and I have no issue in multiplying to the infinite the alternatives modules (worst case scenario that I don't want to apply).

@simahawk
Copy link

@leemannd we don't want existing modules to be refactored on top of the alternative.
You'll have to find a way to support this w/ a glue module or w/ a private fork.

@leemannd
Copy link

Hello @flotho , The module is mature and in production.

For the moment we will fork it. Later we may try to find a way to support it in another way.
We are currently stopping any work related to it and will not go back to the initial implementation for this module in 18.0

@simahawk simahawk changed the title [18.0][MIG] connector_ecommerce: Migration to 18.0 [18.0][MIG] connector_ecommerce: Migration to 18.0 (based on bank payment alternative) Sep 23, 2025
@simahawk simahawk closed this Sep 23, 2025
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.