diff --git a/models/acc_operation.py b/models/acc_operation.py index 282eb580fc5af6ef07c2bd2a33a8616cc7d3672c..5dd021c63ca9af67de6e04b2ccc6dbb5e3e5ebd5 100644 --- a/models/acc_operation.py +++ b/models/acc_operation.py @@ -419,6 +419,7 @@ class AccOperation(models.Model): power_surplus = self.get_power_by_prod( injection_id, date_start, date_end ) + Account = self.env["acc.account"] acc_account = Account.create( @@ -426,7 +427,7 @@ class AccOperation(models.Model): "acc_operation_id": self.id, "buyer_id": injection_id.buyer_id.id, "acc_injection_id": injection_id.id, - "power_cons": power_surplus[1]["power"], + "power_cons": power_surplus[1]["power"] / 1000 / 2, "start_date": date_start, "end_date": date_end, # 'price_kwh': price_kwh, @@ -484,7 +485,7 @@ class AccOperation(models.Model): # Création de la ligne du mois AccountLine.create( { - "quantity": power_surplus[1]["power"], + "quantity": power_surplus[1]["power"] / 1000 / 2, "price_unit": interval.price, "acc_account_id": acc_account.id, "start_date": date_interval_start, diff --git a/report/account_template.xml b/report/account_template.xml index 3e3ee2512b93046841daa49232cff61b588214bd..fe2f7d8c60cd464433a48b4a87b415fa7cab460d 100644 --- a/report/account_template.xml +++ b/report/account_template.xml @@ -493,13 +493,13 @@ <span class="text-nowrap" t-field="line.quantity" - /> + /><span> kWh</span> </td> <td class="text-right"> <span class="text-nowrap" t-field="line.price_unit" - /><span> kWh</span> + /><span> €/kWh</span> </td> <td class="text-right"> <span @@ -547,13 +547,13 @@ <span class="text-nowrap" t-field="line.quantity" - /> + /><span> kWh</span> </td> <td class="text-right"> <span class="text-nowrap" t-field="line.price_unit" - /><span> kWh</span> + /><span> €/kWh</span> </td> <td class="text-right"> <span