Skip to content

Commit

Permalink
use date end line invoice when getting price, instead of invoice date
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJene committed Jul 5, 2022
1 parent 2075d76 commit c4fcb6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion som_generationkwh/giscedata_facturacio.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def apply_gkwh(self, cursor, uid, ids, context=None):
line_vals = invlines_obj.read(
cursor, uid, line_id, line_fields, context=context
)
end_date_line = line_vals['data_fins']
line_product_id = line_vals['product_id'][0]

# GkWh invoice line creation
Expand All @@ -420,7 +421,7 @@ def apply_gkwh(self, cursor, uid, ids, context=None):

price_unit = pricelist_obj.price_get(
cursor, uid, [pricelist], product_gkwh_id, 1,
context={'date': end_date}
context={'date': end_date_line}
)[pricelist]

# Get available gkwh rights
Expand Down

0 comments on commit c4fcb6d

Please sign in to comment.