Hello,
I have a problem with get id.
I create the TransientModel which open a new window with selected records and in this i have my email composer.
And when i select email template i have this method:
@api.onchange('email_template_id')
def _onchange_template_id(self):
if self.email_template_id:
print('self1', self)
print('self2', self._origin)
print('self3', self._origin.id)
print('self4', self.id)
print('currency_id', self.currency_id)
values = self.env['mail.compose.message'].generate_email_for_composer(self.email_template_id.id, [self._origin.id])[self._origin.id]
self.email_body = values['body']
and i wanna to use composer to create body from my template.
But with this NewId i can't use generate_email_for_composer.
Debug for my prints:
self1 purchase.order.groupmail.wizard(<NewId 0x7f905ff24e90>,)
self2 purchase.order.groupmail.wizard()
self3 False
self4 <NewId 0x7f905ff24e90>
currency_id res.currency(17,)