Odoo Help

0
1 Answer
1
Avatar

Yenthe Van Ginneken

--Yenthe Van Ginneken--
13720
| 8 8 10
Belgium
--Yenthe Van Ginneken--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666


Yenthe Van Ginneken
7/27/18, 2:20 AM

Hi Jean,

The function is called from the Python file 'account_invoice.py' in the module 'account'. The code looks like this:

    @api.multi
    def action_invoice_sent(self):
        """ Open a window to compose an email, with the edi invoice template
            message loaded by default
        """
        self.ensure_one()
        template = self.env.ref('account.email_template_edi_invoice', False)
        compose_form = self.env.ref('mail.email_compose_message_wizard_form', False)
        ctx = dict(
            default_model='account.invoice',
            default_res_id=self.id,
            default_use_template=bool(template),
            default_template_id=template and template.id or False,
            default_composition_mode='comment',
            mark_invoice_as_sent=True,
            custom_layout="account.mail_template_data_notification_email_account_invoice",
            force_email=True
        )
        return {
            'name': _('Compose Email'),
            'type': 'ir.actions.act_window',
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'mail.compose.message',
            'views': [(compose_form.id, 'form')],
            'view_id': compose_form.id,
            'target': 'new',
            'context': ctx,
        }

You can find and view it on Github at https://github.com/odoo/odoo/blob/adc97120c94e3a0e8325a40fb0664faa16036f74/addons/account/models/account_invoice.py#L556-L584 

The easiest to find these functions is to use a coding tool to search through the codebase, for example PyCharm or by searching directly on Github.


Regards,
Yenthe

Ask a Question
Writer
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now