You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
570 B

9 years ago
9 years ago
  1. # -*- coding: utf-8 -*-
  2. from openerp import models, api
  3. class SaleOrder(models.Model):
  4. _inherit = 'sale.order'
  5. @api.model
  6. def create(self, vals):
  7. sale_order = super(SaleOrder, self).create(vals)
  8. command_contact = self.env['res.partner'].search([('email', '=', 'commande@bees-coop.be')])[0]
  9. # We do not need to update sale_order.mail_followers_ids, the link is automatic ?!
  10. self.env['mail.followers'].create({'res_model' : 'sale.order', 'res_id' : sale_order.id, 'partner_id' : command_contact.id})
  11. return sale_order