Skip to content
Snippets Groups Projects
Commit 6bab3edd authored by Emanuel Buzey's avatar Emanuel Buzey
Browse files

[REF] energy_selfconsumption: change method name

parent 32b11443
No related branches found
No related tags found
No related merge requests found
Pipeline #64102 passed
......@@ -7,7 +7,7 @@
name="model_id"
ref="energy_selfconsumption.model_energy_selfconsumption_selfconsumption"
/>
<field name="code">model.send_invoicing_reminder()</field>
<field name="code">model.send_energy_delivere_invoicing_reminder()</field>
<field name="user_id" ref="base.user_root" />
<field name='interval_number'>1</field>
<field name='interval_type'>days</field>
......
......@@ -269,7 +269,7 @@ class Selfconsumption(models.Model):
"target": "self",
}
def send_invoicing_reminder(self):
def send_energy_delivery_invoicing_reminder(self):
today = date.today()
date_validation = today + timedelta(days=3)
......
......@@ -85,8 +85,8 @@ class TestInvoicingReminder(TransactionCase):
}
)
def test_send_invoicing_reminder(self):
# Test using send_invoicing_reminder() method to send correctly email
def test_send_energy_delivery_invoicing_reminder(self):
# Test using send_energy_delivery_invoicing_reminder() method to send correctly email
validation_date = date.today() + timedelta(days=3)
self.define_invoicing_mode_wizard.save_data_to_selfconsumption()
self.contract_generation_wizard.generate_contracts_button()
......@@ -95,19 +95,23 @@ class TestInvoicingReminder(TransactionCase):
)
contract.recurring_next_date = validation_date
self.env["energy_selfconsumption.selfconsumption"].send_invoicing_reminder()
self.env[
"energy_selfconsumption.selfconsumption"
].send_energy_delivery_invoicing_reminder()
reminder_mail = self.env["mail.mail"].search(
[("subject", "=", "Selfconsumption - Invoicing Reminder")]
[("subject", "=", "Selfconsumption - Energy Delivered Invoicing Reminder")]
)
self.assertTrue(reminder_mail, "El correo de recordatorio no se envió.")
# Delete sent email to make other test
reminder_mail.unlink()
# Test using the send_invoicing_reminder() method with a record with a date outside the parameter (3 days)
# Test using the send_energy_delivery_invoicing_reminder() method with a record with a date outside the parameter (3 days)
contract.recurring_next_date = validation_date + timedelta(days=1)
self.env["energy_selfconsumption.selfconsumption"].send_invoicing_reminder()
self.env[
"energy_selfconsumption.selfconsumption"
].send_energy_delivery_invoicing_reminder()
reminder_mail = self.env["mail.mail"].search(
[("subject", "=", "Selfconsumption - Invoicing Reminder")]
[("subject", "=", "Selfconsumption - Energy Delivered Invoicing Reminder")]
)
self.assertFalse(reminder_mail, "El correo de recordatorio no se envió.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment