Open ericmachine88 opened 9 years ago
Hi Eric! I didn't test it with v8 yet. Did you fix error?
Hi ericmachine88, I changed the code as suggested but it does not seem to work. Did I miss any thing? Here is the code after the change.
The file is smtp_per_user.py~ --------------------------- start --------------------------
from openerp.osv import orm, fields
class ir_mail_server(osv.Model): _inherit = "ir.mail_server" _columns = { 'user_id': fields.many2one('res.users', string="Owner"), }
class mail_mail(osv.Model): _inherit = "mail.mail" def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None): ir_mail_server = self.pool.get('ir.mail_server') server_id = ir_mail_server.search(cr, uid, [('user_id', '=', uid)], context=context) server_id = server_id and server_id[0] or False if server_id: self.write(cr, uid, ids, {'mail_server_id': server_id}, context=context) return super(mail_mail, self).send(cr, uid, ids, auto_commit=auto_commit, raise_exception=raise_exception, context=context)
--------------------------- end ---------------------------
My bad. I took the forked code from https://github.com/oerp-odoo/base-crm-sale/tree/8.0/smtp_per_user Should have checked before creating noise.
This time using the correct code, bamps/smtp-per-user. Tried it on odoo version 8 and sorry to say that it does not work.
Hi there,
I have tested your module and it didn't worked.
I have 2 users (example)
Both users are under sales manager group (which I have given "read" access in the ir.mail_server model).
I have setup 2 outgoing mail server, which points to each user. Both priority are 10 (the same between 2 users).
10 User 1 SMTP 10 User 2 SMTP
When I login as user 1 and send quotation via email to a test user (ie. customer@gmail.com), it can see it comes from user1@gmail.com.
However when I login as user 2 and do the same as above, it still see it coming from user1@gmail.com.
This doesn't seem right?
Any idea what's causing the problem?
I have tested this on latest v8 module. But I have to fix the codes a bit as follows:-
class mail_mail(osv.Model): _inherit = "mail.mail"
def send(self, cr, uid, ids, auto_commit=False, recipient_ids=None, context=None):
Basically I have replaced the recipient_ids to raise_exception (based on Odoo 8's mail class).
Any help? Thanks.