1
私は自動アクションを作成しました。When to Run
がOn Creation
に設定されていれば問題ありません。私がBased on Timed Condition
に変更した場合、トリガーされません。自動アクションが機能しない - odoo 8
サーバーアクション
私はこれをどのように行うことができますか?
私は自動アクションを作成しました。When to Run
がOn Creation
に設定されていれば問題ありません。私がBased on Timed Condition
に変更した場合、トリガーされません。自動アクションが機能しない - odoo 8
サーバーアクション
私はこれをどのように行うことができますか?
これはPythonコードで行う必要があります。あなたはそれを試しましたか?
私は1つの例があります。パートナー通知メールのために送る:アクションを通じて:
def parnter_create_notification(self, cr, uid, obj, context=None):
if context.get('from_create',False):
group_obj = self.pool.get('res.groups')
user_obj = self.pool.get('res.users')
if obj.customer or obj.supplier:
manager_ids = group_obj.search(cr, uid, [('name','=', 'Financial Manager')])
user_ids = group_obj.browse(cr, uid, manager_ids, context=context)[0].users
email = []
for id in user_ids:
email.append(id.email)
email_to = ','.join(str(e) for e in email)
tmpl_obj = self.pool.get('email.template')
tmpl_ids = tmpl_obj.search(cr, uid, [('name','=','Partner E-mail Template')])
if tmpl_ids:
tmpl_obj.write(cr, uid, tmpl_ids[0], {'email_to':email_to}, context=context)
self.pool.get('email.template').send_mail(cr, uid, tmpl_ids[0], obj.id)
return {}
解像度の継承クラスでは:あなたがPYファイルで定義する必要があります方法は以下のようになり
<record id="action_send_mail_on_partner_creation" model="ir.actions.server">
<field name="name">Partner Creation action</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="type">ir.actions.server</field>
<field name="state">code</field>
<field name="code">self.parnter_create_notification(cr, uid, object, context=context)</field>
</record>
<record id="rule_sent_mail_partner_creation" model="base.action.rule">
<field name="name">Partner Creation Action Rule</field>
<field name="kind">on_create_or_write</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="sequence">1</field>
<field name="filter_id" ref="filter_customer"/>
<field name="active">True</field>
<field name="server_action_ids" eval="[(6, 0, [ref('action_send_mail_on_partner_creation')])]"/>
</record>
を。パートナー。
あなたの問題でこの例を挙げることができます。
希望すると、これが役立ちます。
おかげで、 チャンドニー
あなたがアクションを実行するための条件が満たされていることを確認していますか? – danidee
トリガー日付の値は今日の日付です。例:30-12-2016 – KbiR