Skip to content

Commit

Permalink
[8.0.1.5.0][l10n_id_djbc_lap_mutasi_helper] Fix computation
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Mar 28, 2017
1 parent 3ea46a2 commit 6c78f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions l10n_id_djbc_lap_mutasi_helper/reports/lap_mutasi_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LapMutasiHelper(models.Model):
_name = "l10n_id.djbc_lap_mutasi_helper"
_description = "DJBC Lap. Mutasi Helper"
_auto = False
_order = "date_start asc"

@api.depends(
"report_period_id",
Expand All @@ -25,8 +26,8 @@ def _compute_all(self):
helper.stock_in_qty = 0.0
helper.stock_out_qty = 0.0
helper.ending_balance_qty = 0.0
date_start = helper.date_start + " 00:00:00"
date_end = helper.date_end + " 23:59:00"
date_start = helper.report_period_id.date_start + " 00:00:00"
date_end = helper.report_period_id.date_end + " 23:59:00"
criteria = [
("djbc_custom", "=", True),
("product_id.id", "=", helper.product_id.id),
Expand Down Expand Up @@ -114,14 +115,17 @@ def _compute_all(self):
stock_in_qty = fields.Float(
string="Stock In Qty.",
readonly=True,
compute="_compute_all",
)
stock_out_qty = fields.Float(
string="Stock Out Qty.",
readonly=True,
compute="_compute_all",
)
ending_balance_qty = fields.Float(
string="Ending Balance Qty.",
readonly=True,
compute="_compute_all",
)
warehouse_id = fields.Many2one(
string="Warehouse",
Expand Down Expand Up @@ -187,6 +191,7 @@ def init(self, cr):
FROM ( %s )
WHERE
%s
ORDER BY b.date_start DESC
)""" % (self._table, self._select(), self._from(), self._where()))

@api.model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="name">tree l10n_id.djbc_lap_mutasi_helper</field>
<field name="model">l10n_id.djbc_lap_mutasi_helper</field>
<field name="arch" type="xml">
<tree>
<tree create="false" edit="false" delete="false">
<field name="report_period_id"/>
<field name="date_start"/>
<field name="date_end"/>
Expand Down

0 comments on commit 6c78f34

Please sign in to comment.