mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'mig/12.0/stock_warehouse_procurement' into '12.0'
mig/12.0/stock_warehouse_procurement into 12.0 See merge request hibou-io/hibou-odoo/suite!119
This commit is contained in:
28
stock_warehouse_procurement/README.rst
Normal file
28
stock_warehouse_procurement/README.rst
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
***********************************
|
||||||
|
Hibou - Reorder Rules Per Warehouse
|
||||||
|
***********************************
|
||||||
|
|
||||||
|
Run the inventory scheduler per warehouse.
|
||||||
|
|
||||||
|
For more information and add-ons, visit `Hibou.io <https://hibou.io/docs/hibou-odoo-suite-1/reorder-rules-per-warehouse-163>`_.
|
||||||
|
|
||||||
|
|
||||||
|
=============
|
||||||
|
Main Features
|
||||||
|
=============
|
||||||
|
|
||||||
|
* Extends the `stock.scheduler.compute` wizard to allow the inventory scheduler to run on demand per warehouse.
|
||||||
|
|
||||||
|
.. image:: https://user-images.githubusercontent.com/15882954/45578023-f353d300-b833-11e8-8007-48fa3d96495a.png
|
||||||
|
:alt: 'Run Scheduler Wizard'
|
||||||
|
:width: 988
|
||||||
|
:align: left
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
License
|
||||||
|
=======
|
||||||
|
|
||||||
|
Please see `LICENSE <https://github.com/hibou-io/hibou-odoo-suite/blob/11.0/LICENSE>`_.
|
||||||
|
|
||||||
|
Copyright Hibou Corp. 2018
|
||||||
2
stock_warehouse_procurement/__init__.py
Normal file
2
stock_warehouse_procurement/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
from . import wizard
|
||||||
|
from . import models
|
||||||
20
stock_warehouse_procurement/__manifest__.py
Normal file
20
stock_warehouse_procurement/__manifest__.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
'name': 'Reorder Rules per Warehouse',
|
||||||
|
'version': '12.0.1.0.0',
|
||||||
|
'category': 'Warehouse',
|
||||||
|
'depends': [
|
||||||
|
'stock',
|
||||||
|
],
|
||||||
|
'description': """
|
||||||
|
Extends `stock.scheduler.compute` wizard to allow running on demand per-warehouse.
|
||||||
|
|
||||||
|
""",
|
||||||
|
'author': "Hibou Corp.",
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'website': 'https://hibou.io/',
|
||||||
|
'data': [
|
||||||
|
'wizard/stock_scheduler_compute_views.xml',
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
|
'application': False,
|
||||||
|
}
|
||||||
1
stock_warehouse_procurement/models/__init__.py
Normal file
1
stock_warehouse_procurement/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import procurement
|
||||||
12
stock_warehouse_procurement/models/procurement.py
Normal file
12
stock_warehouse_procurement/models/procurement.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from odoo import models
|
||||||
|
|
||||||
|
|
||||||
|
class ProcurementGroup(models.Model):
|
||||||
|
_inherit = 'procurement.group'
|
||||||
|
|
||||||
|
def _get_orderpoint_domain(self, company_id=False):
|
||||||
|
domain = super(ProcurementGroup, self)._get_orderpoint_domain(company_id)
|
||||||
|
warehouse_id = self.env.context.get('warehouse_id', None)
|
||||||
|
if warehouse_id:
|
||||||
|
domain.append(('warehouse_id', '=', warehouse_id))
|
||||||
|
return domain
|
||||||
1
stock_warehouse_procurement/wizard/__init__.py
Normal file
1
stock_warehouse_procurement/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import stock_scheduler_compute
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class StockSchedulerCompute(models.TransientModel):
|
||||||
|
_inherit = 'stock.scheduler.compute'
|
||||||
|
|
||||||
|
warehouse_id = fields.Many2one('stock.warehouse', string='Warehouse')
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def procure_calculation(self):
|
||||||
|
self.ensure_one()
|
||||||
|
if self.warehouse_id:
|
||||||
|
self = self.with_context(warehouse_id=self.warehouse_id.id)
|
||||||
|
return super(StockSchedulerCompute, self).procure_calculation()
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="view_procurement_compute_wizard" model="ir.ui.view">
|
||||||
|
<field name="name">Run Schedulers Manually</field>
|
||||||
|
<field name="model">stock.scheduler.compute</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_procurement_compute_wizard"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//p" position="after">
|
||||||
|
<group>
|
||||||
|
<field name="warehouse_id"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user