Skip to content
Extraits de code Groupes Projets
Valider 9dab0a89 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[FIX] create new convention from amendment

parent 5cc1a308
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -170,7 +170,7 @@ class Sale(models.Model):
comodel_name="sale.order",
string="Convention initiale",
ondelete="restrict",
copy=True,
copy=False,
)
amendment_ids = fields.One2many(
comodel_name="sale.order",
......@@ -652,8 +652,10 @@ class Sale(models.Model):
# Convention initiale si avenant
convention_id = self if not self.convention_id else self.convention_id
new_convention_id = convention_id.with_context(from_copy=True).copy({
"payment_mode_id": convention_id.payment_mode_id.id
new_convention_id = self.with_context(from_copy=True).copy({
"payment_mode_id": convention_id.payment_mode_id.id,
"convention_id": False,
"is_amendment": False,
})
# Copie des documents existants sur la convention précédente
......@@ -670,7 +672,7 @@ class Sale(models.Model):
<a href="/mail/view?model=sale.order&res_id=%s"
class="o_document_link" data-oe-id="%s" data-oe-model="sale.order"
>%s</a>
""" % (convention_id.id, convention_id.id, convention_id.name)
""" % (self.id, self.id, self.name)
new_convention_id.message_post(
body=body_msg,
)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter