Hello, I want to see the action "action_invoice_sent" which comes with Odoo.
Since Odoo is opensource, it surely is on a .py file on my local Odoo installation right? (I'm currently using Ubuntu 18.04) I am using Odoo 11 CE and have the invoice module and taking a look into the invoice i see some buttons calling this action. I would like to know exactly what parameters does this method requires and also how it is coded. So, where would it be? Inside a class probably? Can anyone give the route for the file containing this action?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
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
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
nov 23
|
1527 | ||
|
0
ago 19
|
3935 | ||
¿how to create planned actions?
Risolto
|
|
2
mar 23
|
2529 | |
|
2
dic 22
|
3423 | ||
|
1
giu 20
|
2683 |