-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
116 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_stock_warehouse_orderpoint_wizard,access_stock_warehouse_orderpoint_wizard,stock_orderpoint_manual_update.model_stock_warehouse_orderpoint_wizard,base.group_user,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- encoding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from . import stock_warehouse_orderpoint_wizard |
24 changes: 24 additions & 0 deletions
24
stock_orderpoint_manual_update/wizard/stock_warehouse_orderpoint_wizard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from odoo import fields, models, _ | ||
|
||
|
||
class StockWarehouseOrderpointWizard(models.TransientModel): | ||
_name = 'stock.warehouse.orderpoint.wizard' | ||
_description = 'Stock Warehouse Orderpoint Wizard' | ||
|
||
company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.company) | ||
partner_ids = fields.Many2many('res.partner', string='Vendor', check_company=True) | ||
category_ids = fields.Many2many('product.category', string='Product Category') | ||
product_ids = fields.Many2many('product.product', string='Product') | ||
|
||
def action_confirm(self): | ||
ctx = self._context.copy() | ||
suppliers = self.env['product.supplierinfo'].search([('partner_id', 'in', self.partner_ids.ids)]) | ||
ctx.update({ | ||
'suppliers': suppliers.ids, | ||
'categories': self.category_ids.ids, | ||
'products': self.product_ids.ids, | ||
}) | ||
self = self.with_context(ctx) | ||
action = self.env['stock.warehouse.orderpoint']._get_orderpoint_action() | ||
return action | ||
|
61 changes: 61 additions & 0 deletions
61
stock_orderpoint_manual_update/wizard/stock_warehouse_orderpoint_wizard_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<record model="ir.ui.view" id="stock_warehouse_orderpoint_wizard"> | ||
<field name="name">stock.warehouse.orderpoint.wizard</field> | ||
<field name="model">stock.warehouse.orderpoint.wizard</field> | ||
<field name="arch" type="xml"> | ||
<form string="Replenishment Filter Wizard"> | ||
<div colspan="2" class="alert alert-info" role="status" attrs="{'invisible': [('partner_ids','=', []), ('category_ids','=', []), ('product_ids','=', [])]}"> | ||
<p><i class="fa fa-info-circle"/>This action will create replenishment lines for products that matches this criteria.</p> | ||
</div> | ||
<group> | ||
<group col="2"> | ||
<field name="company_id" invisible="1"/> | ||
<field name="partner_ids" widget="many2many_tags" context="{'res_partner_search_mode': 'supplier'}"></field> | ||
<field name="product_ids" widget="many2many_tags"/> | ||
</group> | ||
<group col="2"> | ||
<field name="category_ids" widget="many2many_tags"/> | ||
</group> | ||
</group> | ||
<footer> | ||
<button string="Send" name="action_confirm" type="object" class="btn-primary" data-hotkey="q"/> | ||
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
</data> | ||
|
||
<record id="action_stock_warehouse_orderpoint_wizard" model="ir.actions.act_window"> | ||
<field name="name">Manual Create Replenishments</field> | ||
<field name="res_model">stock.warehouse.orderpoint.wizard</field> | ||
<field name="view_ids" | ||
eval="[(5, 0, 0), | ||
(0, 0, {'view_mode': 'form', 'view_id': ref('stock_warehouse_orderpoint_wizard')})]" /> | ||
<field name="target">new</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> |