--- /dev/null
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# POS Membership module for OpenERP, Manage membership payments from POS.
+# Copyright (C) 2013 L'Heureux Cyclage (<http://www.heureux-cyclage.org>)
+#
+# This file is a part of POS Membership
+#
+# POS Membership is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ReMembership 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import osv
+from openerp.osv import fields
+
+class pos_order(osv.osv):
+ _inherit = 'pos.order'
+
+ def _check_membership_product(self, cr, uid, ids, context=None):
+ #TODO : check condition and return boolean accordingly
+ if not context is None:
+ context = {}
+ order_line_obj = self.pool.get('pos.order.line')
+ #order_obj = self.pool.get('pos.order')
+ data_order_line = order_line_obj.browse(cr, uid, ids, context=context)
+ for data in data_order_line:
+ print("INFO: pos_membership - Line:" + data.id),
+ print("Product: " + data.product_id)
+ return True
+
+ _constraints = [
+ (_check_membership_product, 'Error: Invalid Message', ['field_name']),
+ ]
+
+pos_order()
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: