add funcionality to cancel availability
This commit is contained in:
parent
42b773fb6c
commit
409565c81f
36
i18n/ca.po
36
i18n/ca.po
|
@ -1,22 +1,32 @@
|
||||||
# Translation of OpenERP Server.
|
# Translation of OpenERP Server.
|
||||||
# This file contains the translation of the following modules:
|
# This file contains the translation of the following modules:
|
||||||
# * nan_mrp_without_internal_picking
|
# * nan_mrp_without_internal_picking
|
||||||
#
|
#
|
||||||
# Guillem Barba <guillem@nan-tic.com>, 2012.
|
# Guillem Barba <guillem@nan-tic.com>, 2012.
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
||||||
"Report-Msgid-Bugs-To: support@openerp.com\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 17:05+0200\n"
|
"PO-Revision-Date: 2012-07-10 11:57+0200\n"
|
||||||
"Last-Translator: Guillem Barba <guillem@nan-tic.com>\n"
|
"Last-Translator: Ãngel Ãlvarez\n"
|
||||||
"Language-Team: Catalan <>\n"
|
"Language-Team: Catalan <kde-i18n-ca@kde.org>\n"
|
||||||
|
"Language: ca\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \n"
|
"Plural-Forms: \n"
|
||||||
"Language: ca\n"
|
"X-Generator: Lokalize 1.4\n"
|
||||||
"X-Generator: Lokalize 1.2\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
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
||||||
|
@ -29,9 +39,9 @@ msgid "Check Availability"
|
||||||
msgstr "Comprova disponibilitat"
|
msgstr "Comprova disponibilitat"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: view:mrp.production:0
|
#: constraint:mrp.production:0
|
||||||
msgid "Recreate Picking"
|
msgid "Order quantity cannot be negative or zero !"
|
||||||
msgstr "Torna a crear albarà"
|
msgstr "Ordre de producció '%s' planificada pel '%s'"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: code:addons/nan_mrp_without_internal_picking/mrp.py:109
|
#: 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."
|
msgid "Manufacturing order '%s' is scheduled for the %s."
|
||||||
msgstr "Ordre de producció '%s' planificada pel '%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'"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
28
i18n/de.po
28
i18n/de.po
|
@ -1,20 +1,32 @@
|
||||||
# Translation of OpenERP Server.
|
# Translation of OpenERP Server.
|
||||||
# This file contains the translation of the following modules:
|
# This file contains the translation of the following modules:
|
||||||
# * nan_mrp_without_internal_picking
|
# * nan_mrp_without_internal_picking
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
||||||
"Report-Msgid-Bugs-To: support@openerp.com\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"
|
"PO-Revision-Date: 2012-04-30 15:05+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
"Language: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \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
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
||||||
msgid "Manufacturing Order"
|
msgid "Manufacturing Order"
|
||||||
|
@ -26,18 +38,12 @@ msgid "Check Availability"
|
||||||
msgstr "Check Availability"
|
msgstr "Check Availability"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: view:mrp.production:0
|
#: constraint:mrp.production:0
|
||||||
msgid "Recreate Picking"
|
msgid "Order quantity cannot be negative or zero !"
|
||||||
msgstr "Recreate Picking"
|
msgstr "Order quantity cannot be negative or zero !"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: code:addons/nan_mrp_without_internal_picking/mrp.py:109
|
#: code:addons/nan_mrp_without_internal_picking/mrp.py:109
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Manufacturing order '%s' is scheduled for the %s."
|
msgid "Manufacturing order '%s' is scheduled for the %s."
|
||||||
msgstr "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 !"
|
|
||||||
|
|
||||||
|
|
36
i18n/es.po
36
i18n/es.po
|
@ -1,22 +1,32 @@
|
||||||
# Translation of OpenERP Server.
|
# Translation of OpenERP Server.
|
||||||
# This file contains the translation of the following modules:
|
# This file contains the translation of the following modules:
|
||||||
# * nan_mrp_without_internal_picking
|
# * nan_mrp_without_internal_picking
|
||||||
#
|
#
|
||||||
# Guillem Barba <guillem@nan-tic.com>, 2012.
|
# Guillem Barba <guillem@nan-tic.com>, 2012.
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
||||||
"Report-Msgid-Bugs-To: support@openerp.com\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 17:05+0200\n"
|
"PO-Revision-Date: 2012-07-10 11:57+0200\n"
|
||||||
"Last-Translator: Guillem Barba <guillem@nan-tic.com>\n"
|
"Last-Translator: Ãngel Ãlvarez\n"
|
||||||
"Language-Team: Spanish <>\n"
|
"Language-Team: Spanish <kde-i18n-ca@kde.org>\n"
|
||||||
|
"Language: es\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \n"
|
"Plural-Forms: \n"
|
||||||
"Language: es\n"
|
"X-Generator: Lokalize 1.4\n"
|
||||||
"X-Generator: Lokalize 1.2\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
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
||||||
|
@ -29,9 +39,9 @@ msgid "Check Availability"
|
||||||
msgstr "Comprobar disponibilidad"
|
msgstr "Comprobar disponibilidad"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: view:mrp.production:0
|
#: constraint:mrp.production:0
|
||||||
msgid "Recreate Picking"
|
msgid "Order quantity cannot be negative or zero !"
|
||||||
msgstr "Volver a crear albarán"
|
msgstr "La cantidad ordenada no puede ser negativa o cero !"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: code:addons/nan_mrp_without_internal_picking/mrp.py:109
|
#: 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."
|
msgid "Manufacturing order '%s' is scheduled for the %s."
|
||||||
msgstr "Órden de producción '%s' planificada para el '%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 !"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
"Project-Id-Version: OpenERP Server 6.0.2\n"
|
||||||
"Report-Msgid-Bugs-To: support@openerp.com\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"
|
"PO-Revision-Date: 2012-07-10 09:56+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -15,6 +15,16 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \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
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
#: model:ir.model,name:nan_mrp_without_internal_picking.model_mrp_production
|
||||||
msgid "Manufacturing Order"
|
msgid "Manufacturing Order"
|
||||||
|
@ -26,9 +36,9 @@ msgid "Check Availability"
|
||||||
msgstr "Check Availability"
|
msgstr "Check Availability"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: view:mrp.production:0
|
#: constraint:mrp.production:0
|
||||||
msgid "Recreate Picking"
|
msgid "Order quantity cannot be negative or zero !"
|
||||||
msgstr "Recreate Picking"
|
msgstr "Order quantity cannot be negative or zero !"
|
||||||
|
|
||||||
#. module: nan_mrp_without_internal_picking
|
#. module: nan_mrp_without_internal_picking
|
||||||
#: code:addons/nan_mrp_without_internal_picking/mrp.py:109
|
#: 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."
|
msgid "Manufacturing order '%s' is scheduled for the %s."
|
||||||
msgstr "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 !"
|
|
||||||
|
|
||||||
|
|
41
mrp.py
41
mrp.py
|
@ -147,8 +147,8 @@ class mrp_production(osv.osv):
|
||||||
def action_produce(self, cr, uid, production_id, production_qty,
|
def action_produce(self, cr, uid, production_id, production_qty,
|
||||||
production_mode, context=None):
|
production_mode, context=None):
|
||||||
|
|
||||||
res = super(mrp_production,self).action_produce(cr, uid, production_id,
|
res = super(mrp_production,self).action_produce(cr, uid,
|
||||||
production_qty, production_mode, context)
|
production_id, production_qty, production_mode, context)
|
||||||
|
|
||||||
production = self.browse(cr, uid, production_id, context)
|
production = self.browse(cr, uid, production_id, context)
|
||||||
move_ids = [x.id for x in production.move_lines]
|
move_ids = [x.id for x in production.move_lines]
|
||||||
|
@ -159,6 +159,43 @@ class mrp_production(osv.osv):
|
||||||
return res
|
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
|
# mrp.production
|
||||||
def force_production(self, cr, uid, ids, *args):
|
def force_production(self, cr, uid, ids, *args):
|
||||||
""" Assigns products.
|
""" Assigns products.
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new" position="replace">
|
<button name="button_recreate" states="picking_except" string="Recreate Picking" icon="terp-document-new" position="replace">
|
||||||
<button name="check_production" states="confirmed,picking_except" string="Check Availability" type="object" icon="gtk-jump-to"/>
|
<group col="2">
|
||||||
|
<button name="check_production" states="confirmed,picking_except" string="Check Availability" type="object" icon="gtk-jump-to"/>
|
||||||
|
<button name="cancel_availability" states="ready" string="Cancel Availability" type="object" icon="gtk-jump-to"/>
|
||||||
|
</group>
|
||||||
</button>
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
Loading…
Reference in New Issue