diff --git a/i18n/ca.po b/i18n/ca.po index aadb5af..45a4bbe 100644 --- a/i18n/ca.po +++ b/i18n/ca.po @@ -1,22 +1,32 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * nan_mrp_without_internal_picking +# * nan_mrp_without_internal_picking # # Guillem Barba , 2012. msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-04-30 15:05+0000\n" -"PO-Revision-Date: 2012-04-30 17:05+0200\n" -"Last-Translator: Guillem Barba \n" -"Language-Team: Catalan <>\n" +"POT-Creation-Date: 2012-07-10 09:56+0000\n" +"PO-Revision-Date: 2012-07-10 11:57+0200\n" +"Last-Translator: Àngel Àlvarez\n" +"Language-Team: Catalan \n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -"Language: ca\n" -"X-Generator: Lokalize 1.2\n" +"X-Generator: Lokalize 1.4\n" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Recreate Picking" +msgstr "Torna a crear albarà" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Cancel Availability" +msgstr "Cancel·lar disponibilitat" #. module: nan_mrp_without_internal_picking #: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production @@ -29,9 +39,9 @@ msgid "Check Availability" msgstr "Comprova disponibilitat" #. module: nan_mrp_without_internal_picking -#: view:mrp.production:0 -msgid "Recreate Picking" -msgstr "Torna a crear albarà" +#: constraint:mrp.production:0 +msgid "Order quantity cannot be negative or zero !" +msgstr "Ordre de producció '%s' planificada pel '%s'" #. module: nan_mrp_without_internal_picking #: code:addons/nan_mrp_without_internal_picking/mrp.py:109 @@ -39,9 +49,3 @@ msgstr "Torna a crear albarà" msgid "Manufacturing order '%s' is scheduled for the %s." msgstr "Ordre de producció '%s' planificada pel '%s'" -#. module: nan_mrp_without_internal_picking -#: constraint:mrp.production:0 -msgid "Order quantity cannot be negative or zero !" -msgstr "Ordre de producció '%s' planificada pel '%s'" - - diff --git a/i18n/de.po b/i18n/de.po index 1b90d35..c9adf6a 100644 --- a/i18n/de.po +++ b/i18n/de.po @@ -1,20 +1,32 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * nan_mrp_without_internal_picking +# * nan_mrp_without_internal_picking # msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-04-30 15:05+0000\n" +"POT-Creation-Date: 2012-07-10 09:56+0000\n" "PO-Revision-Date: 2012-04-30 15:05+0000\n" "Last-Translator: <>\n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Recreate Picking" +msgstr "Recreate Picking" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +#, fuzzy +msgid "Cancel Availability" +msgstr "Check Availability" + #. module: nan_mrp_without_internal_picking #: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production msgid "Manufacturing Order" @@ -26,18 +38,12 @@ msgid "Check Availability" msgstr "Check Availability" #. module: nan_mrp_without_internal_picking -#: view:mrp.production:0 -msgid "Recreate Picking" -msgstr "Recreate Picking" +#: constraint:mrp.production:0 +msgid "Order quantity cannot be negative or zero !" +msgstr "Order quantity cannot be negative or zero !" #. module: nan_mrp_without_internal_picking #: code:addons/nan_mrp_without_internal_picking/mrp.py:109 #, python-format msgid "Manufacturing order '%s' is scheduled for the %s." msgstr "Manufacturing order '%s' is scheduled for the %s." - -#. module: nan_mrp_without_internal_picking -#: constraint:mrp.production:0 -msgid "Order quantity cannot be negative or zero !" -msgstr "Order quantity cannot be negative or zero !" - diff --git a/i18n/es.po b/i18n/es.po index bb68b10..ed0e4d4 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -1,22 +1,32 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * nan_mrp_without_internal_picking +# * nan_mrp_without_internal_picking # # Guillem Barba , 2012. msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-04-30 15:05+0000\n" -"PO-Revision-Date: 2012-04-30 17:05+0200\n" -"Last-Translator: Guillem Barba \n" -"Language-Team: Spanish <>\n" +"POT-Creation-Date: 2012-07-10 09:56+0000\n" +"PO-Revision-Date: 2012-07-10 11:57+0200\n" +"Last-Translator: Àngel Àlvarez\n" +"Language-Team: Spanish \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -"Language: es\n" -"X-Generator: Lokalize 1.2\n" +"X-Generator: Lokalize 1.4\n" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Recreate Picking" +msgstr "Volver a crear albarán" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Cancel Availability" +msgstr "Cancelar disponibilidad" #. module: nan_mrp_without_internal_picking #: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production @@ -29,9 +39,9 @@ msgid "Check Availability" msgstr "Comprobar disponibilidad" #. module: nan_mrp_without_internal_picking -#: view:mrp.production:0 -msgid "Recreate Picking" -msgstr "Volver a crear albarán" +#: constraint:mrp.production:0 +msgid "Order quantity cannot be negative or zero !" +msgstr "La cantidad ordenada no puede ser negativa o cero !" #. module: nan_mrp_without_internal_picking #: code:addons/nan_mrp_without_internal_picking/mrp.py:109 @@ -39,9 +49,3 @@ msgstr "Volver a crear albarán" msgid "Manufacturing order '%s' is scheduled for the %s." msgstr "Órden de producción '%s' planificada para el '%s'" -#. module: nan_mrp_without_internal_picking -#: constraint:mrp.production:0 -msgid "Order quantity cannot be negative or zero !" -msgstr "La cantidad ordenada no puede ser negativa o cero !" - - diff --git a/i18n/nan_mrp_without_internal_picking.pot b/i18n/nan_mrp_without_internal_picking.pot index 1b90d35..4f6ee60 100644 --- a/i18n/nan_mrp_without_internal_picking.pot +++ b/i18n/nan_mrp_without_internal_picking.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.2\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-04-30 15:05+0000\n" -"PO-Revision-Date: 2012-04-30 15:05+0000\n" +"POT-Creation-Date: 2012-07-10 09:56+0000\n" +"PO-Revision-Date: 2012-07-10 09:56+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,6 +15,16 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Recreate Picking" +msgstr "Recreate Picking" + +#. module: nan_mrp_without_internal_picking +#: view:mrp.production:0 +msgid "Cancel Availability" +msgstr "Cancel Availability" + #. module: nan_mrp_without_internal_picking #: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production msgid "Manufacturing Order" @@ -26,9 +36,9 @@ msgid "Check Availability" msgstr "Check Availability" #. module: nan_mrp_without_internal_picking -#: view:mrp.production:0 -msgid "Recreate Picking" -msgstr "Recreate Picking" +#: constraint:mrp.production:0 +msgid "Order quantity cannot be negative or zero !" +msgstr "Order quantity cannot be negative or zero !" #. module: nan_mrp_without_internal_picking #: code:addons/nan_mrp_without_internal_picking/mrp.py:109 @@ -36,8 +46,3 @@ msgstr "Recreate Picking" msgid "Manufacturing order '%s' is scheduled for the %s." msgstr "Manufacturing order '%s' is scheduled for the %s." -#. module: nan_mrp_without_internal_picking -#: constraint:mrp.production:0 -msgid "Order quantity cannot be negative or zero !" -msgstr "Order quantity cannot be negative or zero !" - diff --git a/mrp.py b/mrp.py index 7393a18..e328d04 100644 --- a/mrp.py +++ b/mrp.py @@ -147,8 +147,8 @@ class mrp_production(osv.osv): def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None): - res = super(mrp_production,self).action_produce(cr, uid, production_id, - production_qty, production_mode, context) + res = super(mrp_production,self).action_produce(cr, uid, + production_id, production_qty, production_mode, context) production = self.browse(cr, uid, production_id, context) move_ids = [x.id for x in production.move_lines] @@ -159,6 +159,43 @@ class mrp_production(osv.osv): return res + # mrp.production + def cancel_availability(self,cr, uid, ids, context): + wf_service = netsvc.LocalService("workflow") + stock_obj = self.pool.get('stock.move') + procurement_obj = self.pool.get('procurement.order') + move_line_ids = [] + procurement_ids = [] + for production in self.browse(cr, uid, ids, context): + move_line_ids += [x.id for x in production.move_lines] + + procurement_ids += procurement_obj.search(cr, uid, + [('origin_production_id','in',ids), + ('procure_method','=','make_to_stock')], + context=context) + + self.write(cr, uid, ids, {'state':'confirmed'}, context=context) + for p_id in ids: + wf_service.trg_validate(uid, 'mrp.production', p_id, + 'action_cancel', cr) + wf_service.trg_delete(uid, 'mrp.production', p_id, cr) + wf_service.trg_create(uid, 'mrp.production', p_id, cr) + + + stock_obj.write(cr, uid, move_line_ids, {'state':'confirmed'}, + context) + + procurement_obj.write(cr, uid, procurement_ids, { + 'state':'draft'}, context=context) + + for proc in self.browse(cr, uid, procurement_ids, context=context): + wf_service.trg_delete(uid, 'procurement.order', proc.id, cr) + wf_service.trg_create(uid, 'procurement.order', proc.id, cr) + wf_service.trg_validate(uid, 'procurement.order', + proc.id, 'button_confirm', cr ) + + return True + # mrp.production def force_production(self, cr, uid, ids, *args): """ Assigns products. diff --git a/mrp_view.xml b/mrp_view.xml index f1380e0..4a93901 100644 --- a/mrp_view.xml +++ b/mrp_view.xml @@ -8,7 +8,10 @@