Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.1.5.0][l10n_id_djbc_lap_mutasi_helper] Fix computation #24

Merged
merged 1 commit into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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