mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-26 01:22:00 +02:00
Initial commit: Accounting packages
This commit is contained in:
commit
4ef34c2317
2661 changed files with 1709616 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.tools.misc import format_datetime
|
||||
|
||||
|
||||
class StockQuantityHistory(models.TransientModel):
|
||||
_inherit = 'stock.quantity.history'
|
||||
|
||||
def open_at_date(self):
|
||||
active_model = self.env.context.get('active_model')
|
||||
if active_model == 'stock.valuation.layer':
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("stock_account.stock_valuation_layer_action")
|
||||
action['domain'] = [('create_date', '<=', self.inventory_datetime), ('product_id.type', '=', 'product')]
|
||||
action['display_name'] = format_datetime(self.env, self.inventory_datetime)
|
||||
return action
|
||||
|
||||
return super(StockQuantityHistory, self).open_at_date()
|
||||
Loading…
Add table
Add a link
Reference in a new issue