From ee16b2e79320b91a3858cadabdcd0cdf1ff1e29d Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Mon, 27 Feb 2012 13:11:29 +0100 Subject: [PATCH] [ADD] nan_prodlot_sample_library: new module that adds new workflow step to Production Lots to get a Sample Library (configuration in company and product) --- __init__.py | 34 +++++++ __openerp__.py | 61 ++++++++++++ company.py | 47 +++++++++ company_view.xml | 16 ++++ i18n/ca.po | 90 +++++++++++++++++ i18n/es.po | 89 +++++++++++++++++ i18n/nan_prodlot_sample_library.pot | 79 +++++++++++++++ prodlot_workflow.xml | 37 +++++++ product.py | 86 +++++++++++++++++ product_view.xml | 17 ++++ sample_library_sequence.xml | 15 +++ stock.py | 144 ++++++++++++++++++++++++++++ stock_view.xml | 39 ++++++++ 13 files changed, 754 insertions(+) create mode 100644 __init__.py create mode 100644 __openerp__.py create mode 100644 company.py create mode 100644 company_view.xml create mode 100644 i18n/ca.po create mode 100644 i18n/es.po create mode 100644 i18n/nan_prodlot_sample_library.pot create mode 100644 prodlot_workflow.xml create mode 100644 product.py create mode 100644 product_view.xml create mode 100644 sample_library_sequence.xml create mode 100644 stock.py create mode 100644 stock_view.xml diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..14e6e8a --- /dev/null +++ b/__init__.py @@ -0,0 +1,34 @@ +############################################################################## +# +# Copyright (c) 2010-2012 NaN Projectes de Programari Lliure, S.L. +# All Rights Reserved. +# http://www.NaN-tic.com +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import company +import product +import stock + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..57f8de3 --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,61 @@ +############################################################################## +# +# Copyright (c) 2010-2012 NaN Projectes de Programari Lliure, S.L. +# All Rights Reserved. +# http://www.NaN-tic.com +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +{ + "name" : "Production Lot Quality Control - Sample Library", + "version" : "1.0", + "author" : "NaN Projectes de Programari Lliure S.L.", + "category" : "Generic Modules/Quality Control", + "website": "http://www.nan-tic.com", + "description": """ + Module developed for Trod y Avia, S.L. + + This module adds the possibility to define that a Product requires that its + Lots must to get a Sample Library to be Valid. + """, + "depends" : [ + 'nan_prodlot_quality_control' + ], + "init_xml" : [], + "update_xml" : [ + 'company_view.xml', + 'product_view.xml', + 'stock_view.xml', + 'prodlot_workflow.xml', + 'sample_library_sequence.xml', + ], + "demo_xml" : [], + "test": [ + #TODO + ], + "active": False, + "installable": True, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/company.py b/company.py new file mode 100644 index 0000000..cc9211e --- /dev/null +++ b/company.py @@ -0,0 +1,47 @@ +############################################################################## +# +# Copyright (c) 2012 NaN Projectes de Programari Lliure, S.L. +# All Rights Reserved. +# http://www.NaN-tic.com +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import osv, fields + +class res_company(osv.osv): + ''' + Adds the field 'requires_sample_library' to configure the default behaviour + of Company's products + ''' + _inherit = 'res.company' + + _columns = { + 'requires_sample_library': fields.boolean('Requires Sample Library', + help="It defines the default value which will be used when a " + "Product is created. Only the Product's field define the final " + "behavior of its lots."), + } +res_company() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/company_view.xml b/company_view.xml new file mode 100644 index 0000000..0e1dcf1 --- /dev/null +++ b/company_view.xml @@ -0,0 +1,16 @@ + + + + + res.company.prodlot.sample_library.form + res.company + form + + + + + + + + + diff --git a/i18n/ca.po b/i18n/ca.po new file mode 100644 index 0000000..29ebf7a --- /dev/null +++ b/i18n/ca.po @@ -0,0 +1,90 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * nan_prodlot_sample_library +# +# 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-02-27 12:02+0000\n" +"PO-Revision-Date: 2012-02-27 13:06+0100\n" +"Last-Translator: Guillem Barba \n" +"Language-Team: Catalan <>\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" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_product_product +msgid "Product" +msgstr "Producte" + +#. module: nan_prodlot_sample_library +#: help:res.company,requires_sample_library:0 +msgid "" +"It defines the default value which will be used when a Product is created. " +"Only the Product's field define the final behavior of its lots." +msgstr "" +"Defineix el comportament per defecte que es tindrà en compte al crear-se un " +"nou producte. Només el camp al producte defineix el comportament final dels " +"seus lots." + +#. module: nan_prodlot_sample_library +#: field:res.company,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library_ro:0 +msgid "Requires Sample Library" +msgstr "Requereix mostra" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_res_company +msgid "Companies" +msgstr "Companyies" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Quality Control Triggers" +msgstr "Disparadors de qualitat" + +#. module: nan_prodlot_sample_library +#: constraint:res.company:0 +msgid "Error! You can not create recursive companies." +msgstr "Error! No podeu crear companyies recursives." + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_stock_production_lot +msgid "Production lot" +msgstr "Lot de producció" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Get Sample" +msgstr "Obté mostra" + +#. module: nan_prodlot_sample_library +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Error: Codi EAN invàlid" + +#. module: nan_prodlot_sample_library +#: field:stock.production.lot,sample_library_code:0 +msgid "Sample Library Code" +msgstr "Codi mostra" + +#. module: nan_prodlot_sample_library +#: sql_constraint:stock.production.lot:0 +msgid "" +"The combination of serial number and internal reference must be unique !" +msgstr "" +"La combinació del número de serie i la referència interna ha de ser única!" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Waiting Sample" +msgstr "Esperant mostra" + + diff --git a/i18n/es.po b/i18n/es.po new file mode 100644 index 0000000..95d1f5d --- /dev/null +++ b/i18n/es.po @@ -0,0 +1,89 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * nan_prodlot_sample_library +# +# 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-02-27 12:02+0000\n" +"PO-Revision-Date: 2012-02-27 13:04+0100\n" +"Last-Translator: Guillem Barba \n" +"Language-Team: Spanish <>\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" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_product_product +msgid "Product" +msgstr "Producto" + +#. module: nan_prodlot_sample_library +#: help:res.company,requires_sample_library:0 +msgid "" +"It defines the default value which will be used when a Product is created. " +"Only the Product's field define the final behavior of its lots." +msgstr "" +"Define el valor por defecte que se usará en el producto al crearlo. Sólo el " +"campo en el producto define el comportamineto final de los lotes." + +#. module: nan_prodlot_sample_library +#: field:res.company,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library_ro:0 +msgid "Requires Sample Library" +msgstr "Require muestra" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Quality Control Triggers" +msgstr "Disparadores de control de calidad" + +#. module: nan_prodlot_sample_library +#: constraint:res.company:0 +msgid "Error! You can not create recursive companies." +msgstr "¡Error! No puede crear compañías recursivas." + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_stock_production_lot +msgid "Production lot" +msgstr "Lote producción" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Get Sample" +msgstr "Obtener muestra" + +#. module: nan_prodlot_sample_library +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Error: Código EAN erróneo" + +#. module: nan_prodlot_sample_library +#: field:stock.production.lot,sample_library_code:0 +msgid "Sample Library Code" +msgstr "Código muestra" + +#. module: nan_prodlot_sample_library +#: sql_constraint:stock.production.lot:0 +msgid "" +"The combination of serial number and internal reference must be unique !" +msgstr "" +"¡La combinación del número de serie y la referencia interna debe ser única!" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Waiting Sample" +msgstr "Esperando muestra" + + diff --git a/i18n/nan_prodlot_sample_library.pot b/i18n/nan_prodlot_sample_library.pot new file mode 100644 index 0000000..48ef4cd --- /dev/null +++ b/i18n/nan_prodlot_sample_library.pot @@ -0,0 +1,79 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * nan_prodlot_sample_library +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.2\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2012-02-27 12:02+0000\n" +"PO-Revision-Date: 2012-02-27 12:02+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_product_product +msgid "Product" +msgstr "Product" + +#. module: nan_prodlot_sample_library +#: help:res.company,requires_sample_library:0 +msgid "It defines the default value which will be used when a Product is created. Only the Product's field define the final behavior of its lots." +msgstr "It defines the default value which will be used when a Product is created. Only the Product's field define the final behavior of its lots." + +#. module: nan_prodlot_sample_library +#: field:res.company,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library:0 +#: field:stock.production.lot,requires_sample_library_ro:0 +msgid "Requires Sample Library" +msgstr "Requires Sample Library" + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_res_company +msgid "Companies" +msgstr "Companies" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Quality Control Triggers" +msgstr "Quality Control Triggers" + +#. module: nan_prodlot_sample_library +#: constraint:res.company:0 +msgid "Error! You can not create recursive companies." +msgstr "Error! You can not create recursive companies." + +#. module: nan_prodlot_sample_library +#: model:ir.model,name:nan_prodlot_sample_library.model_stock_production_lot +msgid "Production lot" +msgstr "Production lot" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Get Sample" +msgstr "Get Sample" + +#. module: nan_prodlot_sample_library +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Error: Invalid ean code" + +#. module: nan_prodlot_sample_library +#: field:stock.production.lot,sample_library_code:0 +msgid "Sample Library Code" +msgstr "Sample Library Code" + +#. module: nan_prodlot_sample_library +#: sql_constraint:stock.production.lot:0 +msgid "The combination of serial number and internal reference must be unique !" +msgstr "The combination of serial number and internal reference must be unique !" + +#. module: nan_prodlot_sample_library +#: view:stock.production.lot:0 +msgid "Waiting Sample" +msgstr "Waiting Sample" + diff --git a/prodlot_workflow.xml b/prodlot_workflow.xml new file mode 100644 index 0000000..1a5022e --- /dev/null +++ b/prodlot_workflow.xml @@ -0,0 +1,37 @@ + + + + + + pending_sample + function + action_wofkflow_pending_sample() + subflow.pending_sample + + + + + + + + + not test_pending_sample() + confirm + + + + + + test_pending_sample() + confirm + + + + + + + not test_pending_sample() + sample_get + + + diff --git a/product.py b/product.py new file mode 100644 index 0000000..517902d --- /dev/null +++ b/product.py @@ -0,0 +1,86 @@ +############################################################################## +# +# Copyright (c) 2010-2012 NaN Projectes de Programari Lliure, S.L. +# All Rights Reserved. +# http://www.NaN-tic.com +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import osv, fields + +class product_product(osv.osv): + """ + Adds the new property field 'requires_sample_library' for Quality Control templates for Lots: generic and + specific templates for input and produced lots. If they are empty, the lots + won't require to pass test. + The generic templates get it's default value from company. + """ + _inherit = 'product.product' + + # product.product + def _search_by_requires_sample_library(self, cr, uid, obj, name, args, + context): + property_proxy = self.pool.get('ir.property') + + res = [] + for fieldname, operator, condition in args: + opposite = False + if operator in ('!=', '<>'): + operator = '=' + opposite = True + + prop_ids = property_proxy.search(cr, uid, [ + ('name', '=', fieldname), + ('res_id', 'like', 'res.partner,%'), + ('value_integer', operator, condition), + ], context=context) + + product_ids = [] + for property in property_proxy.browse(cr, uid, prop_ids, context): + product_ids.append(property.res_id.id) + + operator = 'in' + if opposite: + operator = 'not in' + res.append(('id', operator, product_ids)) + return res + + + _columns = { + 'requires_sample_library': fields.property('product.product', + type='boolean', string="Requires Sample Library", method=True, + view_load=True, fnct_search=_search_by_requires_sample_library), + } + + # product.product + def _default_requires_sample_library(self, cr, uid, context): + user = self.pool.get('res.users').browse(cr, uid, uid, context) + return user.company_id.requires_sample_library + + _defaults = { + 'requires_sample_library': _default_requires_sample_library, + } +product_product() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/product_view.xml b/product_view.xml new file mode 100644 index 0000000..a4c5a7a --- /dev/null +++ b/product_view.xml @@ -0,0 +1,17 @@ + + + + + + product.prodlot.sample_library.form + product.product + form + + + + + + + + + diff --git a/sample_library_sequence.xml b/sample_library_sequence.xml new file mode 100644 index 0000000..6fd105a --- /dev/null +++ b/sample_library_sequence.xml @@ -0,0 +1,15 @@ + + + + + + Production Lot Sample Library + stock.prodlot.sample_library + + + Production Lot Sample Library + stock.prodlot.sample_library + 8 + + + diff --git a/stock.py b/stock.py new file mode 100644 index 0000000..d358c5f --- /dev/null +++ b/stock.py @@ -0,0 +1,144 @@ +############################################################################## +# +# Copyright (c) 2010-2012 NaN Projectes de Programari Lliure, S.L. +# All Rights Reserved. +# http://www.NaN-tic.com +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import osv, fields +import netsvc + +class stock_production_lot( osv.osv ): + _inherit = 'stock.production.lot' + + # stock.production.lot + def get_available_states(self, cr, uid, context=None): + """ + Adds the new state 'pending_sample' before 'pending_test' state. + """ + states_list = super(stock_production_lot, self).get_available_states(cr, + uid, context) + pending_index = states_list.index(('pending_test', 'Waiting QC Test')) + + states_list.insert(pending_index, ('pending_sample', "Pending Sample")) + return states_list + + + # stock.production.lot + def _calc_sample_library_ro(self, cr, uid, ids, fieldname, args, + context=None): + res = {} + for lot in self.browse(cr, uid, ids, context): + res[lot.id] = lot.requires_sample_library + return res + + _columns = { + 'requires_sample_library': fields.boolean('Requires Sample Library', + readonly=True, states={'draft': [('readonly',False)]}), + # Read Only version of previous field. Better solutions are wellcome + 'requires_sample_library_ro': fields.function(_calc_sample_library_ro, + method=True, type='boolean', string='Requires Sample Library', + store = { + 'stock.production.lot': ( + lambda self, cr, uid, ids, c=None: ids, + ['requires_sample_library'], 10), + }), + + 'sample_library_code': fields.char('Sample Library Code', size=64, + readonly=True), + } + + def _default_requires_sample_library(self, cr, uid, context=None): + if context and context.get('product_id'): + product = self.pool.get('product.product').browse(cr, uid, + context['product_id'], context) + return product.requires_sample_library + return False + + _defaults = { + 'requires_sample_library': _default_requires_sample_library, + } + + + # stock.production.lot + def onchange_product_id(self, cr, uid, ids, product_id, context): + if not product_id: + return {} + + product = self.pool.get('product.product').browse(cr, uid, product_id, + context) + return { + 'value': { + 'requires_sample_library': product.requires_sample_library, + }} + + + # stock.production.lot + def test_pending_sample(self, cr, uid, ids, context=None): + """ + Returns True if any of Lot's requires Sample Library + @param ids: IDs of stock.production.lot instances + """ + for lot in self.browse(cr, uid, ids, context): + if lot.requires_sample_library and not lot.sample_library_code: + return True + return False + + + # stock.production.lot + def action_wofkflow_pending_sample(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'state': 'pending_sample'}, context) + return True + + + # stock.production.lot + def action_sample_library(self, cr, uid, ids, context=None): + sequence_proxy = self.pool.get('ir.sequence') + wf_service = netsvc.LocalService("workflow") + + for prodlot in self.browse(cr, uid, ids, context): + if not prodlot.requires_sample_library: + continue + + self.write(cr, uid, [prodlot.id], { + 'sample_library_code': sequence_proxy.get(cr, uid, + 'stock.prodlot.sample_library'), + }, context) + wf_service.trg_validate(uid, 'stock.production.lot', prodlot.id, + 'sample_get', cr) + return True + + + # stock.production.lot + def create(self, cr, uid, vals, context=None): + if 'requires_sample_library' not in vals: + product = self.pool.get('product.product').browse(cr, uid, + vals['product_id'], context) + vals['requires_sample_library'] = product.requires_sample_library + + return super(stock_production_lot, self).create(cr, uid, vals, context) +stock_production_lot() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/stock_view.xml b/stock_view.xml new file mode 100644 index 0000000..12a92be --- /dev/null +++ b/stock_view.xml @@ -0,0 +1,39 @@ + + + + + + stock.production.lot.sample_library.form + stock.production.lot + form + + + + + + + + + + + + + + + + + stock.production.lot.sample_library.filter + stock.production.lot + search + + + + + + + + + +