Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Strange behavior in email_template (Odoo 8.0)

by
Jamotion GmbH, Renzo Meister
- 16/05/2017 09:55:46

Hi community

We have a new module created which is adding some fields to the sale.order.line model. It also changes the calculation of price_subtotal field - and the field is now stored.

In the odoo process everything is working fine. Also when I generate the report for printing it works nice.

But...

When I use the "send mail" button on the sale order, odoo does the following:

  • While opening the mail_compose wizard the default template is preselected and the report is generated sucessfully. All data in report are correct.
  • Now the method onchange_template_id is called and the whole email is again generated. But now the attached report is invalid because of the additional fields of our custom module are not available. The stored price_subtotal field is always set to False.

I have debugged a lot and tried to add many dependencies to solve this problem but without luck. It looks like my redefinition of the sale.order.line class is not used at this time. But I do not understand why...

Thanks for your help!

Freundliche Grüsse

Renzo Meister



Jamotion GmbH
Renzo Meister

CTO

Buchgrindelstrasse 13, 8620 Wetzikon

T +41 44 500 57 01,  M +41 79 418 16 68

rm@jamotion.ch // www.jamotion.ch