Skip to content

Commit

Permalink
[UPD] ssi_inventory_closing
Browse files Browse the repository at this point in the history
  • Loading branch information
Miftahussalam committed Jun 24, 2024
1 parent fd2d074 commit 6295a77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions ssi_inventory_closing/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Contributors
------------

* Usamah <[email protected]>
* Miftahussalam <[email protected]>

Maintainer
----------
Expand Down
13 changes: 11 additions & 2 deletions ssi_inventory_closing/models/inventory_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import pytz

from odoo import api, fields, models
from datetime import datetime

from odoo.addons.ssi_decorator import ssi_decorator

Expand Down Expand Up @@ -244,8 +247,14 @@ def _reload_stock_move(self):

def _prepare_stock_move_domain(self):
self.ensure_one()
date_start = fields.Datetime.to_datetime(self.date_start)
date_end = fields.Datetime.to_datetime(self.date_end)
date_start = fields.Datetime.to_datetime(self.date_start).strftime("%Y-%m-%d %H:%M:%S")
date_end = fields.Datetime.to_datetime(self.date_end).strftime("%Y-%m-%d 23:59:59")
date_start = datetime.strptime(date_start, "%Y-%m-%d %H:%M:%S")
date_end = datetime.strptime(date_end, "%Y-%m-%d %H:%M:%S")
date_start = pytz.UTC.localize(date_start).astimezone(pytz.timezone(
self.company_id.partner_id.tz or "Asia/Jakarta")).strftime("%Y-%m-%d %H:%M:%S")
date_end = pytz.UTC.localize(date_end).astimezone(pytz.timezone(
self.company_id.partner_id.tz or "Asia/Jakarta")).strftime("%Y-%m-%d %H:%M:%S")
return [
"&",
"&",
Expand Down

0 comments on commit 6295a77

Please sign in to comment.