stock_orderpoint_manual_procurement: Migrated to 9.0

This commit is contained in:
lreficent
2016-12-22 15:25:38 +01:00
committed by Joan Sisquella
parent d389b4bdce
commit 945e648d0f
5 changed files with 44 additions and 49 deletions

View File

@@ -9,13 +9,12 @@ Stock Orderpoint Manual Procurement
This module allows users to manually start procurements from the list of
reordering rules, based on the quantity that is recommended to be procured.
Usage
=====
Go to 'Configuration / Reordering Rules' and review the quantity recommended
to be procured. You can now start the procurement for a single or a list of
reordering rules.
Go to 'Inventory > Inventory Control > Reordering Rules' and review the
quantity recommended to be procured. You can now start the procurement for a
single or a list of reordering rules.
The recommended quantity to procure is adjusted to the procurement unit of
measure indicated in the reordering rule.
@@ -28,7 +27,6 @@ procurements from reordering rules', under 'Settings / Users / Users'.
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/153/8.0
Bug Tracker
===========
@@ -49,7 +47,7 @@ Contributors
------------
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
* Lois Rilo Antelo <lois.rilo@eficent.com>
Maintainer
----------

View File

@@ -6,7 +6,7 @@
"name": "Stock Orderpoint manual procurement",
"summary": "Allows to create procurement orders from orderpoints instead "
"of relying only on the scheduler",
"version": "8.0.1.0.0",
"version": "9.0.1.0.0",
"author": "Eficent Business and IT Consulting Services S.L,"
"Odoo Community Association (OCA)",
"website": "https://www.odoo-community.org",
@@ -20,5 +20,5 @@
],
"license": "AGPL-3",
'installable': True,
'application': True,
'application': False,
}

View File

@@ -19,12 +19,14 @@ class StockWarehouseOrderpoint(models.Model):
@api.depends("product_min_qty", "product_id", "qty_multiple")
def _compute_procure_recommended(self):
procurement_model = self.env['procurement.order']
op_qtys = self.subtract_procurements_from_orderpoints(self.ids)
for op in self:
op.procure_recommended_date = \
procurement_model._get_orderpoint_date_planned(
op, datetime.today())
procure_recommended_qty = 0.0
prods = procurement_model._product_virtual_get(op)
prods = op.with_context(
location=op.location_id.id).product_id.virtual_available
if prods is None:
continue
if float_compare(prods, op.product_min_qty,
@@ -41,8 +43,7 @@ class StockWarehouseOrderpoint(models.Model):
precision_rounding=op.product_uom.rounding) <= 0:
continue
qty -= op.subtract_procurements(op)
qty -= op_qtys[op.id]
qty_rounded = float_round(
qty, precision_rounding=op.product_uom.rounding)
if qty_rounded > 0:

View File

@@ -1,19 +1,17 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_procurement_filter" model="ir.ui.view">
<field name="name">procurement.order.select</field>
<field name="model">procurement.order</field>
<field name="inherit_id"
ref="procurement.view_procurement_filter"/>
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="orderpoint_id"/>
</field>
<odoo>
<record id="view_procurement_filter" model="ir.ui.view">
<field name="name">procurement.order.select</field>
<field name="model">procurement.order</field>
<field name="inherit_id"
ref="procurement.view_procurement_filter"/>
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="orderpoint_id"/>
</field>
</record>
</data>
</openerp>
</field>
</record>
</odoo>

View File

@@ -1,29 +1,27 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="inherit_id"
ref="stock.view_warehouse_orderpoint_tree"/>
<field name="arch" type="xml">
<field name="product_uom" position="after">
<field name="procurement_ids" invisible="1"/>
<field name="procure_recommended_qty"/>
<field name="procure_recommended_date"/>
<button string="Create Procurement"
name="%(stock_orderpoint_manual_procurement.act_make_procurement_from_orderpoint)d"
icon="gtk-execute" type="action"/>
<button string="Procurements"
name="%(procurement.procurement_action)d"
attrs="{'invisible':[('procurement_ids', '=', False)]}"
icon="gtk-open" type="action"
domain="[('orderpoint_id','=', active_id)]"
context="{'search_default_orderpoint_id': [active_id]}"/>
</field>
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="inherit_id"
ref="stock.view_warehouse_orderpoint_tree"/>
<field name="arch" type="xml">
<field name="product_uom" position="after">
<field name="procurement_ids" invisible="1"/>
<field name="procure_recommended_qty"/>
<field name="procure_recommended_date"/>
<button string="Create Procurement"
name="%(stock_orderpoint_manual_procurement.act_make_procurement_from_orderpoint)d"
icon="gtk-execute" type="action"/>
<button string="Procurements"
name="%(procurement.procurement_action)d"
attrs="{'invisible':[('procurement_ids', '=', False)]}"
icon="gtk-open" type="action"
domain="[('orderpoint_id','=', active_id)]"
context="{'search_default_orderpoint_id': [active_id]}"/>
</field>
</record>
</field>
</record>
</data>
</openerp>