mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]:added actions to resend emails
This commit is contained in:
@@ -3424,3 +3424,45 @@ class TestPmsReservations(TestPms):
|
||||
partner.id,
|
||||
"The partner was not added to the reservation ",
|
||||
)
|
||||
|
||||
def test_is_modified_reservation(self):
|
||||
"""
|
||||
Checked that the is_modified_reservation field is correctly set
|
||||
to True when the checkin or checkout fields are modified in a
|
||||
reservation.
|
||||
----------------------
|
||||
A reservation is created. The checkin and checkout fields of
|
||||
the reservation are modified. The state of the boolean
|
||||
is_mail_send is changed to True so that the compute of
|
||||
the is_modified_reservation field is activated correctly
|
||||
and it is verified that the state of this field is True.
|
||||
"""
|
||||
# ARRANGE
|
||||
checkin = fields.date.today()
|
||||
checkout = fields.date.today() + datetime.timedelta(days=2)
|
||||
reservation_vals = {
|
||||
"checkin": checkin,
|
||||
"checkout": checkout,
|
||||
"room_type_id": self.room_type_double.id,
|
||||
"partner_id": self.partner1.id,
|
||||
"pms_property_id": self.pms_property1.id,
|
||||
}
|
||||
|
||||
reservation = self.env["pms.reservation"].create(reservation_vals)
|
||||
|
||||
# ACT
|
||||
writed_checkin = fields.date.today() + datetime.timedelta(days=4)
|
||||
writed_checkout = fields.date.today() + datetime.timedelta(days=6)
|
||||
reservation.is_mail_send = True
|
||||
reservation.update(
|
||||
{
|
||||
"checkin": writed_checkin,
|
||||
"checkout": writed_checkout,
|
||||
}
|
||||
)
|
||||
|
||||
# ASSERT
|
||||
self.assertTrue(
|
||||
reservation.is_modified_reservation,
|
||||
"is_modified_reservation field should be True "
|
||||
)
|
||||
|
||||
@@ -1071,6 +1071,10 @@
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="pms.model_pms_reservation" />
|
||||
<field name="binding_view_types">form</field>
|
||||
<field
|
||||
name="context"
|
||||
eval="{'template_id': ref('pms.confirmed_reservation_email')}"
|
||||
/>
|
||||
</record>
|
||||
|
||||
<record id="action_resend_modification_email" model="ir.actions.act_window">
|
||||
@@ -1081,6 +1085,10 @@
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="pms.model_pms_reservation" />
|
||||
<field name="binding_view_types">form</field>
|
||||
<field
|
||||
name="context"
|
||||
eval="{'template_id': ref('pms.modified_reservation_email')}"
|
||||
/>
|
||||
</record>
|
||||
|
||||
<record id="action_resend_cancellation_email" model="ir.actions.act_window">
|
||||
@@ -1091,5 +1099,9 @@
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="pms.model_pms_reservation" />
|
||||
<field name="binding_view_types">form</field>
|
||||
<field
|
||||
name="context"
|
||||
eval="{'template_id': ref('pms.cancelled_reservation_email')}"
|
||||
/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user