diff options
| author | Vidhin Mehta <vme@tinyerp.com> | 2013-08-23 10:36:02 +0530 |
|---|---|---|
| committer | Vidhin Mehta <vme@tinyerp.com> | 2013-08-23 10:36:02 +0530 |
| commit | 75ddd5ccbec73c4a671b6a74efaa3d41dc2ea2db (patch) | |
| tree | 50ed3620df15e8533760f5d47e754a1d39c1e856 /addons/mrp | |
| parent | 42f27a15275effd9c43dfe99e32c395ca6b3fd8a (diff) | |
| parent | a7f4b6aaa0359d12046e81183417c24f093cd7c3 (diff) | |
[MERGE]Trunk.
bzr revid: vme@tinyerp.com-20130823050602-33bqv07e7g8dhv7x
Diffstat (limited to 'addons/mrp')
| -rw-r--r-- | addons/mrp/__openerp__.py | 6 | ||||
| -rw-r--r-- | addons/mrp/html/mrp_calendar.png | bin | 30404 -> 0 bytes | |||
| -rw-r--r-- | addons/mrp/html/mrp_list.png | bin | 45873 -> 0 bytes | |||
| -rw-r--r-- | addons/mrp/html/mrp_mo.png | bin | 61619 -> 0 bytes | |||
| -rw-r--r-- | addons/mrp/i18n/zh_CN.po | 55 | ||||
| -rw-r--r-- | addons/mrp/mrp.py | 29 | ||||
| -rw-r--r-- | addons/mrp/mrp_data.xml | 2 | ||||
| -rw-r--r-- | addons/mrp/mrp_view.xml | 25 | ||||
| -rw-r--r-- | addons/mrp/res_config.py | 4 | ||||
| -rw-r--r-- | addons/mrp/static/description/coppernic.png (renamed from addons/mrp/html/coppernic.png) | bin | 9690 -> 9690 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/icon.png (renamed from addons/mrp/static/src/img/icon.png) | bin | 5663 -> 5663 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/index.html (renamed from addons/mrp/html/index.html) | 2 | ||||
| -rw-r--r-- | addons/mrp/static/description/manufacturing_illu_01.png (renamed from addons/mrp/html/manufacturing_illu_01.png) | bin | 34293 -> 34293 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/manufacturing_illu_02.png (renamed from addons/mrp/html/manufacturing_illu_02.png) | bin | 27856 -> 27856 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_bom.png (renamed from addons/mrp/html/mrp_bom.png) | bin | 47182 -> 47182 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_calendar.png | bin | 0 -> 50093 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_gantt.png (renamed from addons/mrp/html/mrp_gantt.png) | bin | 32416 -> 32416 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_integrate.png (renamed from addons/mrp/html/mrp_integrate.png) | bin | 124045 -> 124045 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_list.png | bin | 0 -> 79477 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_mo.png | bin | 0 -> 125195 bytes | |||
| -rw-r--r-- | addons/mrp/static/description/mrp_product.png (renamed from addons/mrp/html/mrp_product.png) | bin | 64567 -> 64567 bytes | |||
| -rw-r--r-- | addons/mrp/test/order_process.yml | 7 |
22 files changed, 84 insertions, 46 deletions
diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index 6e025ae2d90..83f0a4f11eb 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -77,9 +77,9 @@ Dashboard / Reports for MRP will include: #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company # so the ymls are too complex to change at this stage 'test': [ -# 'test/order_demo.yml', -# 'test/order_process.yml', -# 'test/cancel_order.yml', + 'test/order_demo.yml', + 'test/order_process.yml', + 'test/cancel_order.yml', ], 'installable': True, 'application': True, diff --git a/addons/mrp/html/mrp_calendar.png b/addons/mrp/html/mrp_calendar.png Binary files differdeleted file mode 100644 index a2d52775a0e..00000000000 --- a/addons/mrp/html/mrp_calendar.png +++ /dev/null diff --git a/addons/mrp/html/mrp_list.png b/addons/mrp/html/mrp_list.png Binary files differdeleted file mode 100644 index 5813c32e6b7..00000000000 --- a/addons/mrp/html/mrp_list.png +++ /dev/null diff --git a/addons/mrp/html/mrp_mo.png b/addons/mrp/html/mrp_mo.png Binary files differdeleted file mode 100644 index 6138973570f..00000000000 --- a/addons/mrp/html/mrp_mo.png +++ /dev/null diff --git a/addons/mrp/i18n/zh_CN.po b/addons/mrp/i18n/zh_CN.po index 2722e28fee4..216c9f4d8b9 100644 --- a/addons/mrp/i18n/zh_CN.po +++ b/addons/mrp/i18n/zh_CN.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-11-28 14:03+0000\n" -"Last-Translator: hifly <Unknown>\n" +"PO-Revision-Date: 2013-08-07 16:09+0000\n" +"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-03-16 05:02+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-08-08 04:39+0000\n" +"X-Generator: Launchpad (build 16723)\n" #. module: mrp #: help:mrp.config.settings,module_mrp_repair:0 @@ -69,7 +69,7 @@ msgstr "周期数" msgid "" "The 'Minimum stock rule' allows the system to create procurement orders " "automatically as soon as the minimum stock is reached." -msgstr "最小库存规则允许系统在达到最小库存数量的时候立即创建补货单" +msgstr "最小库存规则允许系统在达到最小库存数量的时会自动创建补货单" #. module: mrp #: code:addons/mrp/report/price.py:130 @@ -199,7 +199,7 @@ msgstr "用于外购的物料" #. module: mrp #: model:ir.ui.menu,name:mrp.menu_mrp_production_order_action msgid "Order Planning" -msgstr "" +msgstr "制造单计划" #. module: mrp #: field:mrp.config.settings,module_mrp_operations:0 @@ -286,7 +286,7 @@ msgstr "从一个生产订单生产几个产品" msgid "" "The selection of the right Bill of Material to use will depend on the " "properties specified on the sales order and the Bill of Material." -msgstr "" +msgstr "被正确使用的BOM依赖于销售单和BOM中指定的属性" #. module: mrp #: view:mrp.bom:0 @@ -294,7 +294,7 @@ msgid "" "When processing a sales order for this product, the delivery order\n" " will contain the raw materials, instead of " "the finished product." -msgstr "" +msgstr "当处理该产品的销售单时,发运单将以原料来替代成品" #. module: mrp #: report:mrp.production.order:0 @@ -490,6 +490,16 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" 创建新属性\n" +" </p><p>\n" +" 当同一个产品有多种组成的方式,\n" +" OpenERP会根据属性来选择合适的BoM。\n" +" 你可以给每个物料清单分配若干个属性,\n" +" 当销售人员创建销售订单,根据需要指定几个属性,\n" +" 然后OpenERP 会根据其来自动选择相应的BoM。\n" +" </p>\n" +" " #. module: mrp #: view:mrp.production:0 @@ -499,7 +509,7 @@ msgid "Scheduled Date" msgstr "下单日期" #. module: mrp -#: code:addons/mrp/procurement.py:124 +#: code:addons/mrp/procurement.py:129 #, python-format msgid "Manufacturing Order <em>%s</em> created." msgstr "生产订单 <em>%s</em> 创建。" @@ -684,7 +694,7 @@ msgid "Work Center Load" msgstr "工作中心负载" #. module: mrp -#: code:addons/mrp/procurement.py:50 +#: code:addons/mrp/procurement.py:55 #, python-format msgid "No BoM defined for this product !" msgstr "该产品尚未定义物料清单!" @@ -991,7 +1001,7 @@ msgid "BoM Type" msgstr "物料清单类型" #. module: mrp -#: code:addons/mrp/procurement.py:52 +#: code:addons/mrp/procurement.py:57 #, python-format msgid "" "Procurement '%s' has an exception: 'No BoM defined for this product !'" @@ -1120,7 +1130,7 @@ msgstr "生产订单" #. module: mrp #: selection:mrp.production,state:0 msgid "Awaiting Raw Materials" -msgstr "" +msgstr "等待原材料" #. module: mrp #: field:mrp.bom,position:0 @@ -1629,6 +1639,17 @@ msgid "" " </p>\n" " " msgstr "" +"<p class=\"oe_view_nocontent_create\">\n" +" 点击创建属性组\n" +" </p><p>\n" +" 可以定义特定的属性组用来分配到BoM和销售订单。\n" +" 根据销售人员在销售订单上选取的属性,OpenERP可以\n" +" 自动选择相应的BoM。\n" +" </p><p>\n" +" 例如,在属性组“保修” ,你有两个属性:1年保修,3年保修。\n" +" 根据销售订单上的选择,OpenERP会自动选择对应的BoM排单生产。\n" +" </p>\n" +" " #. module: mrp #: field:mrp.workcenter,capacity_per_cycle:0 @@ -1774,8 +1795,8 @@ msgid "" "the quantity selected and it will finish the production order when total " "ordered quantities are produced." msgstr "" -"'废料' 模式会仅消耗对应成品数量的原材料而无产成品产出。\n" -"'报工' 模式会消耗对应成品数量的原材料而且产出对应数量的产成品。" +"'投料' 模式会仅消耗对应成品数量的原材料暂无产成品产出。\n" +"'投料并产出' 模式会消耗对应成品数量的原材料并立即产出对应数量的产成品。" #. module: mrp #: view:mrp.production:0 @@ -1981,7 +2002,7 @@ msgstr "新建" #. module: mrp #: selection:mrp.product.produce,mode:0 msgid "Consume Only" -msgstr "废料" +msgstr "投料" #. module: mrp #: view:mrp.production:0 @@ -2161,7 +2182,7 @@ msgstr "用户" #. module: mrp #: selection:mrp.product.produce,mode:0 msgid "Consume & Produce" -msgstr "报工" +msgstr "投料并产出" #. module: mrp #: field:mrp.bom,bom_id:0 @@ -2191,7 +2212,7 @@ msgstr "产品类型是可库存或消耗品" #. module: mrp #: selection:mrp.production,state:0 msgid "Production Started" -msgstr "生产开始了" +msgstr "已开始生产" #. module: mrp #: model:process.node,name:mrp.process_node_procureproducts0 diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 7fb40ce12af..82db2ace570 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -23,11 +23,12 @@ import time from datetime import datetime import openerp.addons.decimal_precision as dp -from openerp.osv import fields, osv +from openerp.osv import fields, osv, orm from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP from openerp.tools import float_compare from openerp.tools.translate import _ from openerp import tools +from openerp import SUPERUSER_ID #---------------------------------------------------------- # Work Centers @@ -405,12 +406,20 @@ class mrp_production(osv.osv): return result def _src_id_default(self, cr, uid, ids, context=None): - src_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context) - return src_location_id.id + try: + location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') + self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) + except (orm.except_orm, ValueError): + location_id = False + return location_id def _dest_id_default(self, cr, uid, ids, context=None): - dest_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context) - return dest_location_id.id + try: + location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') + self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) + except (orm.except_orm, ValueError): + location_id = False + return location_id def _get_progress(self, cr, uid, ids, name, arg, context=None): """ Return product quantity percentage """ @@ -605,8 +614,12 @@ class mrp_production(osv.osv): prod_line_obj = self.pool.get('mrp.production.product.line') workcenter_line_obj = self.pool.get('mrp.production.workcenter.line') for production in self.browse(cr, uid, ids): - cr.execute('delete from mrp_production_product_line where production_id=%s', (production.id,)) - cr.execute('delete from mrp_production_workcenter_line where production_id=%s', (production.id,)) + + p_ids = prod_line_obj.search(cr, SUPERUSER_ID, [('production_id', '=', production.id)], context=context) + prod_line_obj.unlink(cr, SUPERUSER_ID, p_ids, context=context) + w_ids = workcenter_line_obj.search(cr, SUPERUSER_ID, [('production_id', '=', production.id)], context=context) + workcenter_line_obj.unlink(cr, SUPERUSER_ID, w_ids, context=context) + bom_point = production.bom_id bom_id = production.bom_id.id if not bom_point: @@ -872,7 +885,7 @@ class mrp_production(osv.osv): 'move_id': shipment_move_id, 'company_id': production.company_id.id, }) - self.signal_button_confirm(cr, uid, [procurement_id]) + procurement_order.signal_button_confirm(cr, uid, [procurement_id]) return procurement_id def _make_production_internal_shipment_line(self, cr, uid, production_line, shipment_id, parent_move_id, destination_location_id=False, context=None): diff --git a/addons/mrp/mrp_data.xml b/addons/mrp/mrp_data.xml index a6b65b7c475..48e623c532e 100644 --- a/addons/mrp/mrp_data.xml +++ b/addons/mrp/mrp_data.xml @@ -21,7 +21,7 @@ This application supports complete integration and production scheduling for sto <record id="sequence_mrp_prod" model="ir.sequence"> <field name="name">Production order</field> <field name="code">mrp.production</field> - <field name="prefix">MO/</field> + <field name="prefix">MO</field> <field name="padding">5</field> <field name="number_next">1</field> <field name="number_increment">1</field> diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 2af1e876c70..47abeeaf9a9 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -189,7 +189,7 @@ <field name="time_stop" widget="float_time"/> </group> <group string="Costing Information"> - <field name="product_id" on_change="on_change_product_cost(product_id)"/> + <field name="product_id" on_change="on_change_product_cost(product_id)" context="{'default_supply_method':'produce'}"/> <field name="costs_hour"/> <field name="costs_hour_account_id" groups="analytic.group_analytic_accounting"/> <field name="costs_cycle"/> @@ -248,7 +248,7 @@ <field name="model">mrp.routing.workcenter</field> <field name="arch" type="xml"> <form string="Routing Work Centers" version="7.0"> - <group col="4" string="General Information"> + <group col="4"> <field colspan="4" name="name"/> <field name="sequence"/> <field name="workcenter_id"/> @@ -280,7 +280,7 @@ </group> <notebook> <page string="Work Center Operations"> - <field name="workcenter_lines"/> + <field name="workcenter_lines" string="Operation"/> </page> <page string="Notes"> <field name="note"/> @@ -440,7 +440,7 @@ <field name="model">mrp.bom</field> <field name="field_parent">child_complete_ids</field> <field name="arch" type="xml"> - <tree string="Bill of Materials" colors="blue:method"> + <tree string="Bill of Materials"> <field name="sequence" invisible="1"/> <field name="name" invisible="1"/> <field name="product_id"/> @@ -448,7 +448,6 @@ <field name="product_uom" groups="product.group_uom"/> <field name="code"/> <field name="type"/> - <field name="method"/> <field name="routing_id" groups="mrp.group_mrp_routings"/> <field name="date_start"/> <field name="date_stop"/> @@ -460,19 +459,18 @@ <field name="model">mrp.bom</field> <field name="field_parent">child_complete_ids</field> <field name="arch" type="xml"> - <tree string="BoM Structure" colors="blue:method"> + <tree string="BoM Structure"> <field name="sequence" invisible="1"/> <field name="name" groups="base.group_no_one"/> <field name="code"/> <field name="product_id"/> - <field name="bom_id"/> + <field name="bom_id" groups="product.group_mrp_properties"/> <field name="product_qty"/> <field name="product_uom" groups="product.group_uom"/> <field name="type"/> - <field name="method"/> <field name="routing_id" groups="mrp.group_mrp_routings"/> - <field name="date_start"/> - <field name="date_stop"/> + <field name="date_start" groups="product.group_mrp_properties"/> + <field name="date_stop" groups="product.group_mrp_properties"/> </tree> </field> </record> @@ -545,6 +543,7 @@ <field name="type">ir.actions.act_window</field> <field name="res_model">mrp.bom</field> <field name="domain">[('bom_id', '=',active_ids)]</field> + <field name="view_type">tree</field> <field name="view_id" ref="mrp_bom_tree_view"/> </record> <record id="ir_BOM_structure" model="ir.values"> @@ -620,8 +619,8 @@ <form string="Manufacturing Orders" version="7.0"> <header> <button name="button_confirm" states="draft" string="Confirm Production" class="oe_highlight"/> - <button name="%(act_mrp_product_produce)d" states="confirmed,ready,in_production" string="Produce" type="action" class="oe_highlight"/> - <button name="force_production" states="confirmed" string="Force Reservation" type="object"/> + <button name="%(act_mrp_product_produce)d" states="ready,in_production" string="Produce" type="action" class="oe_highlight"/> + <button name="force_production" states="confirmed" string="Force Reservation" type="object" class="oe_highlight"/> <button name="force_production" states="picking_except" string="Force Reservation" type="object"/> <button name="button_produce" states="ready" string="Mark as Started"/> <button name="button_recreate" states="picking_except" string="Recreate Picking"/> @@ -974,7 +973,7 @@ <!-- Menu for Resource for MRP--> <record id="mrp_workcenter_action" model="ir.actions.act_window"> - <field name="name">Work Center</field> + <field name="name">Work Centers</field> <field name="type">ir.actions.act_window</field> <field name="res_model">mrp.workcenter</field> <field name="view_type">form</field> diff --git a/addons/mrp/res_config.py b/addons/mrp/res_config.py index 22a14addcd1..7343990a32f 100644 --- a/addons/mrp/res_config.py +++ b/addons/mrp/res_config.py @@ -36,7 +36,7 @@ class mrp_config_settings(osv.osv_memory): * Repair quotation report * Notes for the technician and for the final customer. This installs the module mrp_repair."""), - 'module_mrp_operations': fields.boolean("Allow detailed planning of work order", + 'module_mrp_operations': fields.boolean("Allow detailed planning of work orders", help="""This allows to add state, date_start,date_stop in production order operation lines (in the "Work Centers" tab). This installs the module mrp_operations."""), 'module_mrp_byproduct': fields.boolean("Produce several products from one manufacturing order", @@ -60,7 +60,7 @@ class mrp_config_settings(osv.osv_memory): help="""Routings allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required raw materials."""), - 'group_mrp_properties': fields.boolean("Allow several bill of materials per products using properties", + 'group_mrp_properties': fields.boolean("Allow several bill of materials per product using properties", implied_group='product.group_mrp_properties', help="""The selection of the right Bill of Material to use will depend on the properties specified on the sales order and the Bill of Material."""), 'module_product_manufacturer': fields.boolean("Define manufacturers on products ", diff --git a/addons/mrp/html/coppernic.png b/addons/mrp/static/description/coppernic.png Binary files differindex 692230a5198..692230a5198 100644 --- a/addons/mrp/html/coppernic.png +++ b/addons/mrp/static/description/coppernic.png diff --git a/addons/mrp/static/src/img/icon.png b/addons/mrp/static/description/icon.png Binary files differindex 600104af507..600104af507 100644 --- a/addons/mrp/static/src/img/icon.png +++ b/addons/mrp/static/description/icon.png diff --git a/addons/mrp/html/index.html b/addons/mrp/static/description/index.html index 5777eb5f147..d44da3f37b1 100644 --- a/addons/mrp/html/index.html +++ b/addons/mrp/static/description/index.html @@ -20,7 +20,7 @@ planning with the smart kanban and gantt views. Use the advanced analytics features to detect bottleneck in resources capacities and inventory locations. </p> <div class="oe_centeralign oe_websiteonly"> - <a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a> + <a href="http://www.openerp.com/start?app=mrp" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a> </div> </div> </div> diff --git a/addons/mrp/html/manufacturing_illu_01.png b/addons/mrp/static/description/manufacturing_illu_01.png Binary files differindex 771223a8dd9..771223a8dd9 100644 --- a/addons/mrp/html/manufacturing_illu_01.png +++ b/addons/mrp/static/description/manufacturing_illu_01.png diff --git a/addons/mrp/html/manufacturing_illu_02.png b/addons/mrp/static/description/manufacturing_illu_02.png Binary files differindex 4a1910c0b73..4a1910c0b73 100644 --- a/addons/mrp/html/manufacturing_illu_02.png +++ b/addons/mrp/static/description/manufacturing_illu_02.png diff --git a/addons/mrp/html/mrp_bom.png b/addons/mrp/static/description/mrp_bom.png Binary files differindex 29b0fd48ca9..29b0fd48ca9 100644 --- a/addons/mrp/html/mrp_bom.png +++ b/addons/mrp/static/description/mrp_bom.png diff --git a/addons/mrp/static/description/mrp_calendar.png b/addons/mrp/static/description/mrp_calendar.png Binary files differnew file mode 100644 index 00000000000..b8afb51443b --- /dev/null +++ b/addons/mrp/static/description/mrp_calendar.png diff --git a/addons/mrp/html/mrp_gantt.png b/addons/mrp/static/description/mrp_gantt.png Binary files differindex 05c9315d5cd..05c9315d5cd 100644 --- a/addons/mrp/html/mrp_gantt.png +++ b/addons/mrp/static/description/mrp_gantt.png diff --git a/addons/mrp/html/mrp_integrate.png b/addons/mrp/static/description/mrp_integrate.png Binary files differindex 954f54953cb..954f54953cb 100644 --- a/addons/mrp/html/mrp_integrate.png +++ b/addons/mrp/static/description/mrp_integrate.png diff --git a/addons/mrp/static/description/mrp_list.png b/addons/mrp/static/description/mrp_list.png Binary files differnew file mode 100644 index 00000000000..39b249fdcf2 --- /dev/null +++ b/addons/mrp/static/description/mrp_list.png diff --git a/addons/mrp/static/description/mrp_mo.png b/addons/mrp/static/description/mrp_mo.png Binary files differnew file mode 100644 index 00000000000..90417cedf83 --- /dev/null +++ b/addons/mrp/static/description/mrp_mo.png diff --git a/addons/mrp/html/mrp_product.png b/addons/mrp/static/description/mrp_product.png Binary files differindex cbfd054d72e..cbfd054d72e 100644 --- a/addons/mrp/html/mrp_product.png +++ b/addons/mrp/static/description/mrp_product.png diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index acbfea48182..801f20f0747 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -94,6 +94,11 @@ procurement_ids = procurement.search(cr, uid, [('move_id','=',move_line.id)]) assert procurement_ids, "Procurement should be created for shipment line of raw materials." shipment_procurement = procurement.browse(cr, uid, procurement_ids[0], context=context) + # procurement state should be `confirmed` at this stage, except if mrp_jit is installed, in which + # case it could already be in `running` or `exception` state (not enough stock) + expected_states = ('confirmed', 'running', 'exception') + assert shipment_procurement.state in expected_states, 'Procurement state is `%s` for %s, expected one of %s' % \ + (shipment_procurement.state, shipment_procurement.product_id.name, expected_states) assert shipment_procurement.date_planned == date_planned, "Planned date is not correspond in procurement." assert shipment_procurement.product_id.id == order_line.product_id.id, "Product is not correspond in procurement." assert shipment_procurement.product_qty == order_line.product_qty, "Qty is not correspond in procurement." @@ -157,9 +162,9 @@ scrap_location_id = scrap_location_ids[0] order = self.browse(cr, uid, ref("mrp_production_test1")) for move in order.move_lines: - move.action_consume(move.product_qty) if move.product_id.id == ref("product.product_product_6"): move.action_scrap(5.0, scrap_location_id) + move.action_consume(move.product_qty) - I produce product. - |
