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

[fix] error refund creation

parent ba89b081
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -177,7 +177,7 @@ class ScopBordereauRefundWizard(models.TransientModel):
for quarter_id in self.quarter_ids:
date_due = self.bordereau_id.invoice_ids.filtered(
lambda i: i.cotiz_quarter == str(quarter_id.quarter) and i.move_type == "out_invoice")[0].invoice_date_due
refund = self.env["account.move"].create(
self.env["account.move"].create(
{
"partner_id": partner_id.id,
"journal_id": cotiz_type.get(int(self.type_cotiz))[1].id,
......@@ -194,17 +194,19 @@ class ScopBordereauRefundWizard(models.TransientModel):
"type_contribution_id": self.type_cotiz,
"payment_mode_id": bordereau_id.payment_mode_id.id,
"invoice_date_due": date_due,
}
)
self.env["account.move.line"].create(
"invoice_line_ids": [
(
0,
None,
{
"name": self.comment,
"move_id": refund.id,
"product_id": product.id,
"account_id": product.property_account_income_id.id,
"quantity": 1,
"name": self.comment,
"price_unit": self.amount_refund,
"price_subtotal": self.amount_refund,
},
),
],
}
)
......
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