X-Git-Url: https://git.cyclocoop.org/?p=burette%2Fetudesetchantiersidf.git;a=blobdiff_plain;f=point_of_sale.py;fp=point_of_sale.py;h=2ea2f212006da121213d9de26745dd6fda1181dd;hp=0000000000000000000000000000000000000000;hb=cb080bacb89f6d070fddc2dc805859926be1b89b;hpb=7e625420fd26cdfc963879e0891e9be925bd1faf
diff --git a/point_of_sale.py b/point_of_sale.py
new file mode 100644
index 0000000..2ea2f21
--- /dev/null
+++ b/point_of_sale.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# etudesetchantiersidf module for OpenERP, Custom module for Ãtude et
+# Chantiers île-de-France
+# Copyright (C) 2014-2018 etudesetchantiersidf
+# ()
+#
+# This file is a part of etudesetchantiersidf
+#
+# etudesetchantiersidf 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.
+#
+# etudesetchantiersidf 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 .
+#
+##############################################################################
+
+from openerp.osv import osv
+from openerp.osv import orm
+from openerp.osv import fields
+
+
+class pos_order_line(orm.Model):
+ _inherit = 'pos.order.line'
+
+ def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False, context=None):
+ res = super(pos_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product_id, qty, partner_id, context=context)
+ if product_id:
+ products_obj = self.pool.get('product.product')
+ product = products_obj.browse(cr, uid, product_id, context=context)
+ res['value'].update({'is_fixed_price': product.is_fixed_price})
+ return res
+
+ _columns = {
+ 'is_fixed_price': fields.boolean('Fixed price'),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: