Skip to content

Commit

Permalink
temp rebasing PR 427 (6581d8e)
Browse files Browse the repository at this point in the history
  • Loading branch information
roboadhoc committed Jan 29, 2024
2 parents 301e750 + 6581d8e commit b049936
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 116 deletions.
1 change: 0 additions & 1 deletion stock_orderpoint_manual_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
# directory
##############################################################################
from . import models
from . import wizard
2 changes: 0 additions & 2 deletions stock_orderpoint_manual_update/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
'purchase_stock',
],
'data': [
'wizard/stock_warehouse_orderpoint_wizard_views.xml',
'security/ir.model.access.csv',
'views/stock_warehouse_orderpoint_views.xml',
],
'demo': [
Expand Down
21 changes: 0 additions & 21 deletions stock_orderpoint_manual_update/models/stock_orderpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,6 @@ def _get_orderpoint_action(self):
self.update_qty_forecast()
return action

def _get_orderpoint_products(self):
domain = [('type', '=', 'product'), ('stock_move_ids', '!=', False)]

# Filter by suppliers
suppliers_ids = self._context.get('suppliers')
suppliers = self.env['product.supplierinfo'].browse(suppliers_ids)
if suppliers:
domain += ['|', ('product_tmpl_id', 'in', suppliers.product_tmpl_id.ids), ('id', 'in', suppliers.product_id.ids)]

# Filter by product categories
category_ids = self._context.get('categories')
if category_ids:
domain += [('categ_id', 'in', category_ids)]

# Filter by products
product_ids = self._context.get('products')
if product_ids:
domain += [('id', 'in', product_ids)]

return self.env['product.product'].search(domain)

def update_qty_forecast(self):
orderpoints = self.with_context(active_test=False).search([])
for rec in orderpoints:
Expand Down
2 changes: 0 additions & 2 deletions stock_orderpoint_manual_update/security/ir.model.access.csv

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ patch(StockOrderpointListController.prototype, "order patch", {

patch(StockOrderpointListController.prototype, "recompute patch", {
async onClickRecomputeOrderpoint() {
return this.actionService.doAction('stock_orderpoint_manual_update.action_stock_warehouse_orderpoint_wizard');
return this.actionService.doAction('stock.action_replenishment');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,25 @@
</field>
</record>

<record id="cron_create_orderpoints" model="ir.cron">
<field name="name">Replenishment: create new lines</field>
<field name="model_id" ref="stock.model_stock_warehouse_orderpoint"/>
<field name="state">code</field>
<field name="code">model._get_orderpoint_action()</field>
<field name="active" eval="True"/>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
</record>

<record id="stock.action_orderpoint_replenish" model="ir.actions.act_window">
<field name="context">{'search_default_filter_to_reorder': 1, 'search_default_filter_not_snoozed': 1}</field>
</record>

<menuitem
id="stock.menu_reordering_rules_replenish"
action="stock.action_orderpoint_replenish"
name="Replenishment" parent="stock.menu_stock_warehouse_mgmt" sequence="5"
groups="stock.group_stock_manager"/>

</odoo>
4 changes: 0 additions & 4 deletions stock_orderpoint_manual_update/wizard/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b049936

Please sign in to comment.