فهرست منبع

commit incial

Rodney Enciso Arias 8 سال پیش
کامیت
95a591607f

+ 23 - 0
__init__.py

@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2015-DRC Systems India Pvt. Ltd.
+#    (<http://www.drcsystems.com>)
+#
+#    This program 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.
+#
+#    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 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/>
+#
+##############################################################################
+
+import model_pos

BIN
__init__.pyc


+ 34 - 0
__openerp__.py

@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+{
+    'name': "POS Customer",
+
+    'summary': """
+        It alerts for the customer selection before Payment.""",
+
+    'description': """
+        It alerts for the customer selection before Payment.
+    """,
+
+    'author': "DRC Systems India Pvt. Ltd.",
+    'website': "http://www.drcsystems.com",
+
+    # Categories can be used to filter modules in modules listing
+    # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
+    # for the full list
+    'category': 'Point Of Sale',
+    'version': '0.1',
+
+    # any module necessary for this one to work correctly
+    'depends': ['base','point_of_sale'],
+
+    # always loaded
+    'data': [
+        'templates.xml',
+    ],
+    # only loaded in demonstration mode
+    'demo': [
+    ],
+
+    'installable': True,
+    'auto_install': False,
+}

+ 8 - 0
model_pos.py

@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+
+from openerp import models, fields, api
+
+class pos_config(models.Model):
+	_inherit = 'pos.config'
+
+	is_customer_mandatory = fields.Boolean("Requerir Cliente", help='An option to mandatory customer selection before payment in POS session')

BIN
model_pos.pyc


BIN
static/description/alert.png


BIN
static/description/customer1.png


BIN
static/description/icon.png


+ 47 - 0
static/description/index.html

@@ -0,0 +1,47 @@
+<section class="oe_container">
+    <div class="oe_row oe_spaced">
+        <div class="oe_span12">
+            <h2 class="oe_slogan">Configuration to mandatory customer selection before payment</h2>
+        </div>
+        <div class="oe_span6">
+            <p class='oe_mt32'>
+                Configuration option to set the customer is required or not.
+            </p>
+        </div>
+        <div class="oe_span6">
+             <img class="oe_picture oe_screenshot" src="mandatory.png"/>
+        </div>
+    </div>
+</section>
+
+<section class="oe_container">
+    <div class="oe_row oe_spaced">
+        <div class="oe_span12">
+            <h2 class="oe_slogan">It Alerts for the customer selection while Payment.</h2>
+        </div>
+        <div class="oe_span6">
+             <img class="oe_picture oe_screenshot" src="customer1.png"/>
+        </div>
+        <div class="oe_span6">
+            <p class='oe_mt32'>
+                This module is useful to keep mendatory customer selection in the Point Of Sale while Payment.
+            </p>
+        </div>
+    </div>
+</section>
+
+<section class="oe_container oe_dark">
+    <div class="oe_row">
+        <h2 class="oe_slogan">Alert on Payment</h2>
+        <div class="oe_span6">
+            <p class='oe_mt32'>
+                Alert on Payment method for Customer Selection.
+            </p>
+        </div>
+        <div class="oe_span6">
+            <div class="oe_bg_img oe_centered">
+                <img class="oe_picture oe_screenshot" src="alert.png">
+            </div>
+        </div>
+    </div>
+</section>

BIN
static/description/mandatory.png


+ 31 - 0
static/src/js/pos_client.js

@@ -0,0 +1,31 @@
+openerp.pos_validate_client = function (instance) {
+
+    var QWeb = instance.web.qweb;
+    var _t = instance.web._t;
+    var module=instance.point_of_sale
+
+    module.PaypadButtonWidget = module.PaypadButtonWidget.extend({
+        renderElement: function() {
+            var self = this;
+
+            this._super();
+            if(self.pos.config.is_customer_mandatory){
+                this.$el.unbind('click');
+
+                this.$el.click(function(){
+                    if(self.pos.get('selectedOrder').get_client()){
+                        if (self.pos.get('selectedOrder').get('screen') === 'receipt'){  //TODO Why ?
+                            console.warn('TODO should not get there...?');
+                            return;
+                        }
+                        self.pos.get('selectedOrder').addPaymentline(self.cashregister);
+                        self.pos_widget.screen_selector.set_current_screen('payment');
+                    }
+                    else{
+                        alert("Debes Elegir un Cliente..!!");
+                    }
+                });
+            }
+        },
+    });
+}

+ 21 - 0
templates.xml

@@ -0,0 +1,21 @@
+<openerp>
+    <data>
+       <template id="pos_client" name="pos client" inherit_id="web.assets_backend">
+            <xpath expr="." position="inside">
+                <script type="text/javascript" src="/pos_validate_client/static/src/js/pos_client.js"></script>
+            </xpath>
+        </template>
+
+        <record id="view_pos_customer_form" model="ir.ui.view">
+        	<field name="name">pos.customer.form.view</field>
+        	<field name="model">pos.config</field>
+        	<field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>
+        	<field name="arch" type="xml">
+        		<xpath expr="//field[@name='iface_invoicing']" position="after">
+        			<field name="is_customer_mandatory" id="is_mendatory"/>
+        		</xpath>
+        	</field>
+        </record>
+
+    </data>
+</openerp>