Skip to Content
Menu
This question has been flagged
3 Replies
4258 Views
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="status_from_cron_scheduler_action_customer" model="ir.cron">
<field name="name">Customers Scheduler</field>
<field name="user_id" ref="base.user_root"/>
<field name="model_id" ref="model_shopify_connector" />
<field name="state">code</field>
<field name="active">0</field>
<field name="function">_import_customers()</field>
<field name="args" eval="(True,)" />
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
</record>
</odoo>

ValueError: <class 'TypeError'>: "import_customers() missing 1 required positional argument: 'is_auto'" while evaluating
'model.import_customers()'

def import_customers(self, is_auto):
"""
code
"""



Avatar
Discard
Best Answer

You have defined is_auto as a parameter in function but you did not filled that parameter while calling that method from scheduler. You can make is_auto=False in function definition or you need to pass that paramater from scheduler xml file.

Avatar
Discard
Author Best Answer

In last fourth line i did it.

Avatar
Discard
Best Answer


<record id="status_from_cron_scheduler_action_customer" model="ir.cron">
<field name="name">Customers Scheduler</field>
<field name="user_id" ref="base.user_root"/>
<field name="model_id" ref="model_shopify_connector" />
<field name="state">code</field>
<field name="code">import_customers(True)</field>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
</record>


Avatar
Discard
Related Posts Replies Views Activity
2
Apr 20
13961
1
Jan 20
5905
2
Dec 23
12010
0
Oct 23
33
3
Oct 23
787