[REF] sale: make variables name clearer

closes odoo/odoo#74246

Related: odoo/upgrade#2691
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Valentin Chevalier
2021-08-02 07:50:13 +00:00
parent a46c9b0f21
commit b0e2c2b945
4 changed files with 32 additions and 24 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ class PaymentTransaction(models.Model):
self._invoice_sale_orders()
res = super()._reconcile_after_done()
if self.env['ir.config_parameter'].sudo().get_param('sale.automatic_invoice'):
default_template = self.env['ir.config_parameter'].sudo().get_param('sale.default_email_template')
default_template = self.env['ir.config_parameter'].sudo().get_param('sale.default_invoice_email_template')
if default_template:
for trans in self.filtered(lambda t: t.sale_order_ids):
trans = trans.with_company(trans.acquirer_id.company_id).with_context(
+23 -15
View File
@@ -47,21 +47,29 @@ class ResConfigSettings(models.TransientModel):
module_sale_coupon = fields.Boolean("Coupons & Promotions")
module_sale_amazon = fields.Boolean("Amazon Sync")
automatic_invoice = fields.Boolean("Automatic Invoice",
help="The invoice is generated automatically and available in the customer portal "
"when the transaction is confirmed by the payment acquirer.\n"
"The invoice is marked as paid and the payment is registered in the payment journal "
"defined in the configuration of the payment acquirer.\n"
"This mode is advised if you issue the final invoice at the order and not after the delivery.",
config_parameter='sale.automatic_invoice')
template_id = fields.Many2one('mail.template', 'Email Template',
domain="[('model', '=', 'account.move')]",
config_parameter='sale.default_email_template',
default=lambda self: self.env.ref('account.email_template_edi_invoice', False))
confirmation_template_id = fields.Many2one('mail.template', string='Confirmation Email',
domain="[('model', '=', 'sale.order')]",
config_parameter='sale.default_confirmation_template',
help="Email sent to the customer once the order is paid.")
automatic_invoice = fields.Boolean(
string="Automatic Invoice",
help="The invoice is generated automatically and available in the customer portal when the "
"transaction is confirmed by the payment acquirer.\nThe invoice is marked as paid and "
"the payment is registered in the payment journal defined in the configuration of the "
"payment acquirer.\nThis mode is advised if you issue the final invoice at the order "
"and not after the delivery.",
config_parameter='sale.automatic_invoice',
)
invoice_mail_template_id = fields.Many2one(
comodel_name='mail.template',
string='Invoice Email Template',
domain="[('model', '=', 'account.move')]",
config_parameter='sale.default_invoice_email_template',
default=lambda self: self.env.ref('account.email_template_edi_invoice', False)
)
confirmation_mail_template_id = fields.Many2one(
comodel_name='mail.template',
string='Confirmation Email Template',
domain="[('model', '=', 'sale.order')]",
config_parameter='sale.default_confirmation_template',
help="Email sent to the customer once the order is paid."
)
def set_values(self):
super(ResConfigSettings, self).set_values()
@@ -209,8 +209,8 @@
Automatic email sent after the customer has signed or paid online
</div>
<div class="row mt16">
<label for="confirmation_template_id" string="Email Template" class="col-lg-4 o_light_label"/>
<field name="confirmation_template_id" class="oe_inline"/>
<label for="confirmation_mail_template_id" class="col-lg-4 o_light_label"/>
<field name="confirmation_mail_template_id" class="oe_inline"/>
</div>
</div>
</div>
@@ -405,8 +405,8 @@
Generate the invoice automatically when the online payment is confirmed
</div>
<div attrs="{'invisible': [('automatic_invoice','=',False)]}" groups="base.group_no_one">
<label for="template_id" class="o_light_label"/>
<field name="template_id" class="oe_inline" options="{'no_create': True}"/>
<label for="invoice_mail_template_id" class="o_light_label"/>
<field name="invoice_mail_template_id" class="oe_inline" options="{'no_create': True}"/>
</div>
</div>
</div>
@@ -282,8 +282,8 @@
Generate the invoice automatically when the online payment is confirmed
</div>
<div attrs="{'invisible': [('automatic_invoice','=',False)]}">
<label for="template_id" class="o_light_label"/>
<field name="template_id" class="oe_inline"/>
<label for="invoice_mail_template_id" class="o_light_label"/>
<field name="invoice_mail_template_id" class="oe_inline"/>
</div>
</div>
</div>
@@ -318,8 +318,8 @@
Email sent to the customer after the checkout
</div>
<div class="row mt16">
<label for="confirmation_template_id" string="Email Template" class="col-lg-4 o_light_label"/>
<field name="confirmation_template_id" class="oe_inline"/>
<label for="confirmation_mail_template_id" class="col-lg-4 o_light_label"/>
<field name="confirmation_mail_template_id" class="oe_inline"/>
</div>
</div>
</div>