Compare commits
No commits in common. "19.0" and "main" have entirely different histories.
@ -1,6 +1,6 @@
|
||||
{
|
||||
'name': 'Stock Readjust Valuation',
|
||||
'version': '19.0.1.0.0',
|
||||
'version': '17.0.1.0.0',
|
||||
'category': 'Inventory/Inventory',
|
||||
'summary': 'Retrospective Stock Valuation Adjustment',
|
||||
'description': """
|
||||
|
||||
@ -42,7 +42,7 @@ class StockReadjustValuation(models.Model):
|
||||
'name': _('Journal Entries'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'account.move',
|
||||
'view_mode': 'list,form',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': [('id', 'in', self.account_move_ids.ids)],
|
||||
'context': {'create': False},
|
||||
}
|
||||
@ -437,11 +437,11 @@ class StockReadjustValuation(models.Model):
|
||||
date_map[t['date_svl']].append(svl.id)
|
||||
|
||||
for d, ids in date_map.items():
|
||||
self.env.cr.execute("UPDATE stock_valuation_layer SET create_date = %s WHERE id IN %s", (d, tuple(ids)))
|
||||
self._cr.execute("UPDATE stock_valuation_layer SET create_date = %s WHERE id IN %s", (d, tuple(ids)))
|
||||
|
||||
# 4a. Force Dates Moves (Per Chunk)
|
||||
if chunk_moves:
|
||||
self.env.cr.execute("UPDATE account_move SET date = %s WHERE id IN %s", (self.date_end.date(), tuple(chunk_moves.ids)))
|
||||
self._cr.execute("UPDATE account_move SET date = %s WHERE id IN %s", (self.date_end.date(), tuple(chunk_moves.ids)))
|
||||
|
||||
# Link Created Moves to this record (Important for Resume Logic)
|
||||
self.write({'account_move_ids': [(4, m.id) for m in chunk_moves]})
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<notebook>
|
||||
<page string="Products">
|
||||
<field name="line_ids" readonly="state == 'done'">
|
||||
<list editable="bottom" create="1" delete="1">
|
||||
<tree editable="bottom" create="1" delete="1">
|
||||
<field name="product_id" readonly="parent.state != 'draft'"/>
|
||||
|
||||
<field name="initial_qty"/>
|
||||
@ -50,7 +50,7 @@
|
||||
<field name="purchase_value" optional="show"/>
|
||||
|
||||
<field name="new_average_cost" decoration-bf="1"/>
|
||||
</list>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
@ -64,18 +64,18 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- List View -->
|
||||
<!-- Tree View -->
|
||||
<record id="view_stock_readjust_valuation_tree" model="ir.ui.view">
|
||||
<field name="name">stock.readjust.valuation.tree</field>
|
||||
<field name="model">stock.readjust.valuation</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'done'"/>
|
||||
</list>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
<record id="action_stock_readjust_valuation" model="ir.actions.act_window">
|
||||
<field name="name">Stock Readjustment</field>
|
||||
<field name="res_model">stock.readjust.valuation</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user