Skip to content

Commit

Permalink
[UPD] ssi_stock_account
Browse files Browse the repository at this point in the history
* Menambahkan tombol pada stock.picking form untuk membuka SVL
  • Loading branch information
andhit-r committed Jul 16, 2024
1 parent 73c1fae commit fb47308
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ssi_stock_account/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,25 @@ def action_delete_accounting_entry(self):
record._delete_accounting_entry()

def action_reload_accounting_setting(self):
for record in self:
for record in self.sudo():
record._reload_accounting_setting()

def action_open_svl(self):
for record in self.sudo():
result = record._open_svl()
return result

def _open_svl(self):
waction = self.env.ref("stock_account.stock_valuation_layer_action").read()[0]
waction.update(
{
"view_mode": "tree,form",
"domain": [("id", "in", self.stock_valuation_layer_ids.ids)],
"context": {},
}
)
return waction

def _create_accounting_entry(self):
self.ensure_one()
for svl in self.stock_valuation_layer_ids:
Expand Down
8 changes: 8 additions & 0 deletions ssi_stock_account/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<field name="create_accounting_entry_ok" invisible="1" />
</group>
<separator string="SVL" />
<button
name="action_open_svl"
type="object"
string="Open SVL"
class="oe_highlight"
icon="fa-bars"
style="margin-right:4px"
/>
<field name="stock_valuation_layer_ids" />
<separator string="Journal Entries" />
<button
Expand Down

0 comments on commit fb47308

Please sign in to comment.