mollie / mollie-odoo

Mollie Payments plugin for Odoo - an open source CRM and ERP
29 stars 49 forks source link

Mollie subscription ept #138

Closed dhyeyp-emipro closed 1 month ago

dhyeyp-emipro commented 1 year ago

[MOD] Modified code as per given feedback

bvanjeelharia commented 1 year ago

Also, changes requested in the manifest file have not been done

dhyeyp-emipro commented 1 year ago

It is necessary to include the Python dependencies line. Because Python dependencies must be configured on the system when installing this module. If not, then the module will not be able to request the API.

bvanjeelharia commented 1 year ago

'external_dependencies': { 'python': ['mollie-api-python'] },

it needs to be replaced by this piece of code

dhyeyp-emipro commented 1 year ago

Modified code as per given feedback.

bvanjeelharia commented 1 year ago

Yes, working fine @dhyeyp-emipro

dhyeyp-emipro commented 1 year ago

Changes uploaded, Please verify it from your end.

bvanjeelharia commented 1 year ago

Yes, seems fine

bvanjeelharia commented 1 year ago

Still facing issues, which is probably happening because of mollie notify(webhook) is working fine on the instance.The system is trying to process the data twice I believe.

Here are the logs: 2023-04-24 14:10:18,927 76 INFO nwb odoo.addons.payment_mollie.controllers.main: Received Mollie notify data: {'id': 'tr_qYgFfEzY7U', 'ref': 'S00467'} 2023-04-24 14:10:21,321 76 INFO nwb werkzeug: 87.233.217.243 - - [24/Apr/2023 14:10:21] "POST /payment/mollie/notify?ref=S00467 HTTP/1.0" 200 - 386 0.278 2.127 2023-04-24 14:10:21,420 69 INFO nwb odoo.addons.base.models.ir_cron: Starting job automatic invoicing: send ready invoice. 2023-04-24 14:10:21,429 69 INFO nwb odoo.addons.base.models.ir_cron: Job automatic invoicing: send ready invoice done. 2023-04-24 14:10:22,408 78 INFO nwb odoo.addons.payment_mollie.controllers.main: Received Mollie return data: {'ref': 'S00467'} 2023-04-24 14:10:22,947 78 INFO nwb odoo.addons.payment.models.payment_transaction: tried to write tx state with same value (ref: S00467, state: done) 2023-04-24 14:10:22,955 78 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:22] "GET /payment/mollie/return?ref=S00467 HTTP/1.0" 303 - 21 0.013 0.537 2023-04-24 14:10:23,381 64 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:23] "GET /payment/status HTTP/1.0" 200 - 16 0.013 0.038 2023-04-24 14:10:23,646 78 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:23] "GET /base_fontawesome/static/lib/fontawesome-5.13.0/webfonts/fa-solid-400.woff2 HTTP/1.0" 404 - 2 0.001 0.004 2023-04-24 14:10:23,648 76 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:23] "GET /base_fontawesome/static/lib/fontawesome-5.13.0/webfonts/fa-regular-400.woff2 HTTP/1.0" 404 - 2 0.002 0.006 2023-04-24 14:10:23,658 61 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:23] "GET /base_fontawesome/static/lib/fontawesome-5.13.0/webfonts/fa-brands-400.woff2 HTTP/1.0" 404 - 2 0.001 0.006 2023-04-24 14:10:23,950 61 INFO nwb werkzeug: 103.183.54.203 - - [24/Apr/2023 14:10:23] "GET /web/webclient/qweb/1682345423816?bundle=web.assets_frontend HTTP/1.0" 200 - 16 0.008 0.053 2023-04-24 14:10:24,348 61 INFO nwb odoo.http: called ignoring args 2023-04-24 14:10:24,369 61 ERROR nwb odoo.addons.payment.controllers.post_processing: encountered an error while post-processing transactions with ids 356: There is nothing to invoice!

Reason(s) of this behavior could be:

Reason(s) of this behavior could be:

Also , attaching screenshot from front end: Screenshot from 2023-04-24 20-26-58

dhyeyp-emipro commented 1 year ago

As per the logs, It looks like the product configuration-related issue.

bvanjeelharia commented 1 year ago

The changes seem to be fine

bvanjeelharia commented 1 year ago

@dhyeyp-emipro , Found these issue from logs, please check: 2023-05-05 08:10:53,217 70 ERROR odoodb odoo.addons.base.models.ir_cron: Call from cron Update Mollie Payments for server action #724 failed in Job #35 Traceback (most recent call last): File "/odoo/src/odoo/models.py", line 5210, in ensure_one _id, = self._ids ValueError: too many values to unpack (expected 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/odoo/src/odoo/tools/safe_eval.py", line 332, in safe_eval return unsafe_eval(c, globals_dict, locals_dict) File "", line 1, in File "/odoo/external-src/mollie_subscription_ept/models/mollie_payment.py", line 149, in auto_update_payments if payment_obj and payment_obj.status != payment['status']: File "/odoo/src/odoo/fields.py", line 1075, in get record.ensure_one() File "/odoo/src/odoo/models.py", line 5213, in ensure_one raise ValueError("Expected singleton: %s" % self) ValueError: Expected singleton: mollie.payment(3166, 3167)

dhyeyp-emipro commented 1 year ago

@bvanjeelharia It is due to multiple payments associated with the same subscription. But didn't understand how multiple payments were associated with any single subscription.

odoo-mvds commented 1 month ago

Hi,

Thank you for your contribution and for submitting the pull request (PR).

We have reviewed your PR and appreciate your effort. Currently, we have no plans to implement a subscription module in the near future. When we do address this feature, we aim to keep the code minimal and manage it via tokens/mandates. As a result, we will be closing this PR.

We truly appreciate your effort and interest in improving the project.

Best regards,