mollie-odoo icon indicating copy to clipboard operation
mollie-odoo copied to clipboard

Mollie subscription ept

Open dhyeyp-emipro opened this issue 1 year ago • 12 comments

[MOD] Modified code as per given feedback

dhyeyp-emipro avatar Mar 15 '23 10:03 dhyeyp-emipro

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

bvanjeelharia avatar Mar 15 '23 12:03 bvanjeelharia

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.

dhyeyp-emipro avatar Mar 15 '23 12:03 dhyeyp-emipro

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

it needs to be replaced by this piece of code

bvanjeelharia avatar Mar 15 '23 13:03 bvanjeelharia

Modified code as per given feedback.

dhyeyp-emipro avatar Mar 23 '23 09:03 dhyeyp-emipro

Yes, working fine @dhyeyp-emipro

bvanjeelharia avatar Apr 04 '23 11:04 bvanjeelharia

Changes uploaded, Please verify it from your end.

dhyeyp-emipro avatar Apr 11 '23 11:04 dhyeyp-emipro

Yes, seems fine

bvanjeelharia avatar Apr 12 '23 07:04 bvanjeelharia

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 <csrf_token=208074e1143a76b95dae92fd8984614e2a10c7e6o1713881423> 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:

  • You should deliver your products before invoicing them.
  • You should modify the invoicing policy of your product: Open the product, go to the "Sales" tab and modify invoicing policy from "delivered quantities" to "ordered quantities". For Services, you should modify the Service Invoicing Policy to 'Prepaid'. Traceback (most recent call last): File "/odoo/src/addons/payment/controllers/post_processing.py", line 81, in poll_status txs_to_post_process._finalize_post_processing() File "/odoo/src/addons/website_payment/models/payment_transaction.py", line 13, in _finalize_post_processing super()._finalize_post_processing() File "/odoo/src/addons/payment/models/payment_transaction.py", line 859, in _finalize_post_processing self._reconcile_after_done() File "/odoo/src/addons/sale/models/payment_transaction.py", line 102, in _reconcile_after_done self._invoice_sale_orders() File "/odoo/src/addons/sale/models/payment_transaction.py", line 153, in _invoice_sale_orders invoices = confirmed_orders._create_invoices() File "/odoo/src/addons/sale_timesheet/models/sale_order.py", line 111, in _create_invoices moves = super()._create_invoices(grouped=grouped, final=final, date=date) File "/odoo/src/addons/sale/models/sale_order.py", line 775, in _create_invoices raise self._nothing_to_invoice_error() odoo.exceptions.UserError: There is nothing to invoice!

Reason(s) of this behavior could be:

  • You should deliver your products before invoicing them.
  • You should modify the invoicing policy of your product: Open the product, go to the "Sales" tab and modify invoicing policy from "delivered quantities" to "ordered quantities". For Services, you should modify the Service Invoicing Policy to 'Prepaid'.

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

bvanjeelharia avatar Apr 24 '23 14:04 bvanjeelharia

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

dhyeyp-emipro avatar Apr 25 '23 04:04 dhyeyp-emipro

The changes seem to be fine

bvanjeelharia avatar Apr 27 '23 07:04 bvanjeelharia

@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)

bvanjeelharia avatar May 05 '23 08:05 bvanjeelharia

@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.

dhyeyp-emipro avatar May 08 '23 13:05 dhyeyp-emipro

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,

odoo-mvds avatar May 27 '24 08:05 odoo-mvds