Closed diezcode closed 8 years ago
@diezcode what exactly is your problem and/or is not working? I'll need some more information before I can help you along. :+1:
Thank you for you're time. @Yenthe666 I never getting an email with this example. I'm receiving nothing and I don't know why. I want to add a button in odoo, that when I push it, it sends me a simple email with a subject and a text.
no idea? ;)
Sorry @diezcode this got lost in my filled up mailbox.. :sheep: Add some log statements and see if the function is triggered when you click on the button. Also make sure that you have an outgoing mailserver & that it is working fine.
No, it's not going in the function... I don't know why,
Sounds to me like either your Python files are not loaded or that you haven't included them. Could you place your code on your Github and link it here? I'll try to have a look at it then.
So here is it: https://github.com/diezcode/test_mail_module
I hope you can tell me what I am doing wrong in this module.
Thank you my friend
@diezcode see https://github.com/diezcode/test_mail_module/pull/1 you've missed the @api.one statement before the method.
I have this error:
@api.one
NameError: name 'api' is not defined
Ok the modul works, but it don't going in the function. How can I call this function send_mail_example.
Update your modules list + db and see if works then. Add log statements to double check it doesn't go there. I'm going to guess you didn't update your module.
2015-11-13 11:09:54,762 3720 ERROR db_testing_modul werkzeug: Error on request: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi execute(self.server.app) File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute application_iter = app(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 281, in app return self.app(e, s) File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 216, in application return application_unproxied(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 202, in application_unproxied result = handler(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1280, in call return self.dispatch(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1254, in call return self.app(environ, start_wrapped) File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 579, in call return self.app(environ, start_response) File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1412, in dispatch ir_http = request.registry['ir.http'] File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 339, in registry return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 335, in get update_module) File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 366, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 351, in load_modules force, status, report, loaded_modules, update_module) File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 255, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/usr/lib/python2.7/dist-packages/openerp/modules/loading.py", line 152, in load_module_graph models = registry.load(cr, package) File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 162, in load model = cls._build_model(self, cr) File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 591, in _build_model original_module = pool[name]._original_module if name in parents else cls._module File "/usr/lib/python2.7/dist-packages/openerp/modules/registry.py", line 101, in getitem return self.models[model_name] KeyError: 'mail.mail'
what means this? _inherit = 'mail.mail' is wrong?
add 'mail' module in your dependency list at openerp.py
Exactly what atchuthan says. Add it here: https://github.com/diezcode/test_mail_module/blob/master/base_mail_test/__openerp__.py#L9
Okay that works now, thank you guys, The function isn't called out . I updated the modul and tryed to debug the function, but it's not going inside....
@Yenthe666 @atchuthan i'ts not working ;(
I don't get it , why it's never going in the function when I click the button ;(
Can you help me with this email script?
I dont get it, this is my base.py file:
from openerp import models, fields, api from openerp.osv import fields, osv
The form is with this: