Skip to content

Commit

Permalink
browse the right obj
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJene committed Aug 17, 2022
1 parent ba02cbf commit 18b4850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions som_generationkwh/giscedata_facturacio.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ def update_maj_quantity(self, cursor, uid, inv_id, context):
if not rmag_lines_ids:
return

rmag_line = self.browse(cursor, uid, rmag_lines_ids[0])

line_obj = self.pool.get('giscedata.facturacio.factura.linia')
rmag_line = line_obj.browse(cursor, uid, rmag_lines_ids[0])

cfg_obj = self.pool.get('res.config')

start_date_mecanisme_ajust_gas = cfg_obj.get(
Expand Down
2 changes: 1 addition & 1 deletion som_generationkwh/som_generationkwh.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def getProfit(self, cr, uid, line):
if rmag_lines and \
line['data_desde'] >= start_date_mecanisme_ajust_gas and \
line['data_fins'] <= end_date_mecanisme_ajust_gas:
rmag_line = self.browse(cr, uid, rmag_lines_ids[0])
rmag_line = gffl_obj.browse(cr, uid, rmag_lines_ids[0])
profit = (priceNoGen + rmag_line.price_unit - line['price_unit']) * line['quantity']
else:
profit = (priceNoGen - line['price_unit']) * line['quantity']
Expand Down

0 comments on commit 18b4850

Please sign in to comment.