trigger an automatic reminder email.
""",
'author': 'OpenERP SA',
- 'website': 'http://www.openerp.com',
+ 'website': 'https://www.odoo.com',
'depends': ['base', 'resource', 'mail'],
'data': [
+ 'base_action_rule_data.xml',
'base_action_rule_view.xml',
'security/ir.model.access.csv',
- 'base_action_rule_data.xml'
],
'demo': [],
'installable': True,
model = action_rule.model_id.model
model_obj = self.pool[model]
if not hasattr(model_obj, 'base_action_ruled'):
- model_obj.create = self._wrap_create(model_obj.create, model)
- model_obj.write = self._wrap_write(model_obj.write, model)
+ # monkey-patch methods create and write
+ model_obj._patch_method('create', make_create())
+ model_obj._patch_method('write', make_write())
model_obj.base_action_ruled = True
updated = True
+
return updated
+ def _update_cron(self, cr, uid, context=None):
+ try:
+ cron = self.pool['ir.model.data'].get_object(
+ cr, uid, 'base_action_rule', 'ir_cron_crm_action', context=context)
+ except ValueError:
+ return False
+
+ return cron.toggle(model=self._name, domain=[('kind', '=', 'on_time')])
+
def create(self, cr, uid, vals, context=None):
res_id = super(base_action_rule, self).create(cr, uid, vals, context=context)
if self._register_hook(cr, [res_id]):
""",
'author': 'OpenERP SA',
'category': 'Hidden/Dependency',
- 'website': 'http://www.openerp.com',
+ 'website': 'https://www.odoo.com/page/crm',
'demo': ['calendar_demo.xml'],
'data': [
+ 'calendar_cron.xml',
'security/ir.model.access.csv',
'security/calendar_security.xml',
'calendar_view.xml',
For more specific needs, you may also assign custom-defined actions
(technically: Server Actions) to be triggered for each incoming mail.
""",
- 'website': 'http://www.openerp.com',
+ 'website': 'https://www.odoo.com/page/mailing',
'data': [
- 'fetchmail_view.xml',
'fetchmail_data.xml',
+ 'fetchmail_view.xml',
'security/ir.model.access.csv',
'fetchmail_installer_view.xml'
],
def action_button_confirm(self, cr, uid, ids, context=None):
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
- self.signal_order_confirm(cr, uid, ids)
+ self.signal_workflow(cr, uid, ids, 'order_confirm')
-
- # redisplay the record as a sales order
- view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
- view_id = view_ref and view_ref[1] or False,
- return {
- 'type': 'ir.actions.act_window',
- 'name': _('Sales Order'),
- 'res_model': 'sale.order',
- 'res_id': ids[0],
- 'view_type': 'form',
- 'view_mode': 'form',
- 'view_id': view_id,
- 'target': 'current',
- 'nodestroy': True,
- }
-
+ return True
+
def action_wait(self, cr, uid, ids, context=None):
context = context or {}
for o in self.browse(cr, uid, ids):