[IMP] stock: Forecast Report cleanup
This commit is contained in:
@@ -497,6 +497,11 @@ class Product(models.Model):
|
||||
def action_update_quantity_on_hand(self):
|
||||
return self.product_tmpl_id.with_context({'default_product_id': self.id}).action_update_quantity_on_hand()
|
||||
|
||||
def action_product_forecast_report(self):
|
||||
action = self.env.ref('stock.report_stock_quantity_action_product').read()[0]
|
||||
action['domain'] = [('product_id', '=', self.id)]
|
||||
return action
|
||||
|
||||
@api.model
|
||||
def get_theoretical_quantity(self, product_id, location_id, lot_id=None, package_id=None, owner_id=None, to_uom=None):
|
||||
product_id = self.env['product.product'].browse(product_id)
|
||||
@@ -759,6 +764,11 @@ class ProductTemplate(models.Model):
|
||||
|
||||
return action
|
||||
|
||||
def action_product_tmpl_forecast_report(self):
|
||||
action = self.env.ref('stock.report_stock_quantity_action').read()[0]
|
||||
action['domain'] = [('product_id', 'in', self.product_variant_ids.ids)]
|
||||
return action
|
||||
|
||||
class ProductCategory(models.Model):
|
||||
_inherit = 'product.category'
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<filter string="Forecasted Stock" name="filter_forecast" domain="[('state', '=', 'forecast')]"/>
|
||||
<filter string="Forecasted Receipts" name="filter_in" domain="[('state', '=', 'in')]"/>
|
||||
<filter string="Forecasted Deliveries" name="filter_out" domain="[('state', '=', 'out')]"/>
|
||||
<filter string="Date" name="filter_date" date="date"/>
|
||||
</group>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Date" name="groupby_date" domain="[]" context="{'group_by':'date:day'}"/>
|
||||
@@ -39,7 +40,7 @@
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="context">{
|
||||
'search_default_filter_forecast': 1,
|
||||
'graph_groupbys': ['date:day', 'state'],
|
||||
'graph_groupbys': ['date:day', 'state', 'product_id'],
|
||||
}</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -225,10 +225,10 @@
|
||||
<span class="o_stat_text">On Hand</span>
|
||||
</div>
|
||||
</button>
|
||||
<button type="action"
|
||||
name="%(stock.report_stock_quantity_action_product)d"
|
||||
<button type="object"
|
||||
name="action_product_forecast_report"
|
||||
attrs="{'invisible':[('type', '!=', 'product')]}"
|
||||
context="{'search_default_product_id': id, 'default_product_id': id}"
|
||||
context="{'default_product_id': id}"
|
||||
class="oe_stat_button" icon="fa-cubes">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
@@ -317,10 +317,10 @@
|
||||
<span class="o_stat_text">On Hand</span>
|
||||
</div>
|
||||
</button>
|
||||
<button type="action"
|
||||
name="%(stock.report_stock_quantity_action_product)d"
|
||||
<button type="object"
|
||||
name="action_product_tmpl_forecast_report"
|
||||
attrs="{'invisible':[('type', '!=', 'product')]}"
|
||||
context="{'search_default_product_tmpl_id': id, 'default_product_tmpl_id': id}"
|
||||
context="{'default_product_tmpl_id': id}"
|
||||
class="oe_stat_button" icon="fa-cubes">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
|
||||
Reference in New Issue
Block a user