Skip to Content
Menú
This question has been flagged
2 Respostes
2914 Vistes

hello


I am trying to use payment provider V.16 on Odoo V.17 i Think i have fixed most of the issues but still remening with this problem


 File "/home/odoo/src/odoo/odoo/tools/convert.py", line 39, in 
    safe_eval = lambda expr, ctx={}: s_eval(expr, ctx, nocopy=True)
  File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 379, in safe_eval
    raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
ValueError: : "External ID not found in the system: payment.payment_icon_cc_mastercard" while evaluating
"[(6, 0, [ref('payment.payment_icon_cc_mastercard'),ref('payment.payment_icon_cc_visa'),])]"



i think is the problem is happening because of the Data/payment_provider_data.xml in this line




Avatar
Descartar
Autor Best Answer

I have changed it to 

( from 16 to 17 they changed mastercard and visa to just payment_method_card??)


field name="payment_method_ids"

               eval="[(6, 0, [

                   ref('payment.payment_method_card'),

               ])]"/>

i think it should be like this but i get new error

TypeError: post_init_hook() missing 1 required positional argument: 'registry'


Update 

fixed it by changing int.py

 from post_init_hook(cr, registry) ----> post_init_hook(env)


but not im getting error after getting redircted i get Error call back url is not found


Avatar
Descartar

why you use post_init_hook change

Autor

Last Update ( hopfully )

I have added some module in the main DB but when i click pay now i get this error

(('bool' object has no attribute 'replace'))

Best Answer

Hi Yahya Kassem,

version up to 16 use code like (6,0) or (4,0) to add value but in odoo17 change.

you can use like this way

'child_ids': [Command.set([action1.id, action2.id, action3.id, action4.id])],

that means you need to add like this way comma separated if you add more then one.

'groups_id': [Command.set([self.ref('base.group_partner_manager')])]

Thanks.


Avatar
Descartar
Autor

I am sorry but i didnt understand So i have to change the XML to
<field name="payment_icon_ids"
eval="[Command.set(6, 0, [ref('payment.payment_icon_cc_mastercard'), ref('payment.payment_icon_cc_visa'),])]"/>

or change the py file?

yes its correct add same ass xml file but why you use 6,0 in set tuple

<field name="payment_icon_ids" eval="[Command.set([ref('payment.payment_icon_cc_mastercard'), ref('payment.payment_icon_cc_visa')])]"/>

Autor

its not my app actually i don't know why he used 6,0

its an payment gateway that transfer you to the provider website

for your information odoo use specific code insert or update or delete data so [6,0] means when you add many2many field add data so [6,0] add your new data in that field and remove existing data.

And Those codes are use previous version like 16,15,14,13,12.
In 17.0 you need to use Command.set()

Autor

Thank you for Explaining i have remove it and change the code to <field name="payment_method_ids" eval="[ref('payment.payment_method_card'),]"/>

Autor

This is the Error message im mentioned up phoneno = self.partner_phone.replace(" ", "").replace("-", "").replace("+", "")
AttributeError: 'bool' object has no attribute 'replace'

phoneno = self.partner_phone.replace(" ", "").replace("-", "").replace("+", "")

here in this code partner_phone in not any value means False and you access and try to replace so thats why error occur bool object has no attribute 'replace'

Related Posts Respostes Vistes Activitat
1
de febr. 24
2036
1
de febr. 23
1767
0
de maig 21
1884
1
de maig 25
3836
2
d’oct. 23
56