15 changed files with 375 additions and 0 deletions
			
			
		| @ -0,0 +1,28 @@ | |||||
|  | ==================================== | ||||
|  | Floor Wise Charges in Restaurant v10 | ||||
|  | ==================================== | ||||
|  | This module adds floor wise charging facility in POS Restaurant. | ||||
|  | 
 | ||||
|  | Installation | ||||
|  | ============ | ||||
|  | Just select it from available modules to install it, there is no need to extra installations. | ||||
|  | 
 | ||||
|  | Configuration | ||||
|  | ============= | ||||
|  | Nothing to configure. | ||||
|  | 
 | ||||
|  | Usage | ||||
|  | ===== | ||||
|  | * Create some Facility and its charging percentage. | ||||
|  | * POS-> Configuration-> Floor Facility. | ||||
|  | 
 | ||||
|  | * Add created facility to floors. | ||||
|  | * POS-> Configuration-> Floor Plans-> Add Facility Lines | ||||
|  | 
 | ||||
|  | * On clicking a product in pos screen, Amount will add automatically. | ||||
|  | 
 | ||||
|  | Credits | ||||
|  | ======= | ||||
|  | Developer: Nilmar Shereef @ cybrosys, shereef@cybrosys.in | ||||
|  | 
 | ||||
|  | 
 | ||||
| @ -0,0 +1,22 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | import models | ||||
| @ -0,0 +1,42 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    Author: Nilmar Shereef(<http://www.cybrosys.com>) | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | { | ||||
|  |     'name': 'Floor Wise Charge in Restaurant', | ||||
|  |     'version': '10.0.1.0.0', | ||||
|  |     'summary': """Product Price Change Based on Floor of POS Restaurant.""", | ||||
|  |     'description': """Module adds the facility charge of floor with each products in POS restaurant""", | ||||
|  |     'author': 'Cybrosys Techno Solutions', | ||||
|  |     'website': "http://www.cybrosys.com", | ||||
|  |     'company': 'Cybrosys Techno Solutions', | ||||
|  |     'category': 'Point Of Sale', | ||||
|  |     'depends': ['point_of_sale', | ||||
|  |                 'pos_restaurant'], | ||||
|  |     'data': [ | ||||
|  |         'views/pos_restaurant_extra_facility.xml', | ||||
|  |         'views/templates.xml', | ||||
|  |         ], | ||||
|  |     'images': ['static/description/banner.jpg'], | ||||
|  |     'license': 'LGPL-3', | ||||
|  |     'installable': True, | ||||
|  |     'auto_install': False, | ||||
|  | } | ||||
| @ -0,0 +1,23 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    Author: Nilmar Shereef(<http://www.cybrosys.com>) | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | import pos_restaurant_extra_facility | ||||
| @ -0,0 +1,61 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################## | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | #    Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). | ||||
|  | #    Author: Nilmar Shereef(<http://www.cybrosys.com>) | ||||
|  | #    you can modify it under the terms of the GNU LESSER | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | ||||
|  | # | ||||
|  | #    It is forbidden to publish, distribute, sublicense, or sell copies | ||||
|  | #    of the Software or modified copies of the Software. | ||||
|  | # | ||||
|  | #    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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | ||||
|  | # | ||||
|  | #    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | ||||
|  | #    GENERAL PUBLIC LICENSE (LGPL v3) along with this program. | ||||
|  | #    If not, see <http://www.gnu.org/licenses/>. | ||||
|  | # | ||||
|  | ############################################################################## | ||||
|  | from odoo import models, fields, api | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class FacilityRestaurant(models.Model): | ||||
|  | 
 | ||||
|  |     _inherit = "restaurant.floor" | ||||
|  | 
 | ||||
|  |     rest_floor_facility = fields.One2many('restaurant.floor.line', 'ref_field', string='Floor Facility') | ||||
|  |     facility_service_percentage = fields.Float(string="Active Facility Charge %", readonly=True) | ||||
|  | 
 | ||||
|  |     @api.onchange('rest_floor_facility') | ||||
|  |     def onchange_facility(self): | ||||
|  |         sum_of_percentage = 0.0 | ||||
|  |         for records in self.rest_floor_facility: | ||||
|  |             sum_of_percentage += records.line_percentage | ||||
|  |         self.facility_service_percentage = sum_of_percentage | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class FacilityRestaurantLines(models.Model): | ||||
|  |     _name = "restaurant.floor.line" | ||||
|  | 
 | ||||
|  |     name = fields.Many2one('restaurant.floor.facility') | ||||
|  |     line_percentage = fields.Float(string="Extra Charging Percentage") | ||||
|  |     ref_field = fields.Many2one('restaurant.floor', invisible=True, ondelete='cascade') | ||||
|  | 
 | ||||
|  |     @api.onchange('name') | ||||
|  |     def onchange_facility(self): | ||||
|  |         if self.name: | ||||
|  |             self.line_percentage = self.name.percentage | ||||
|  | 
 | ||||
|  | 
 | ||||
|  | class FloorFacility(models.Model): | ||||
|  | 
 | ||||
|  |     _name = "restaurant.floor.facility" | ||||
|  | 
 | ||||
|  |     name = fields.Char(string="Name", required=True,) | ||||
|  |     percentage = fields.Float(string="Extra Charging Percentage(%)", required=True, | ||||
|  |                               help="Increment percentage of the each Product Price ") | ||||
|  |     description = fields.Html(string="Description") | ||||
| After Width: | Height: | Size: 71 KiB | 
| After Width: | Height: | Size: 92 KiB | 
| After Width: | Height: | Size: 96 KiB | 
| After Width: | Height: | Size: 89 KiB | 
| After Width: | Height: | Size: 70 KiB | 
| After Width: | Height: | Size: 50 KiB | 
| @ -0,0 +1,100 @@ | |||||
|  | <section class="oe_container"> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <h2 class="oe_slogan">Floor Wise Charges in Restaurant</h2> | ||||
|  |         <h3 class="oe_slogan">User can set floor facility charges on Products</h3> | ||||
|  |         <h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4> | ||||
|  |         <div> | ||||
|  |             <h4><p>Features:</p></h4> | ||||
|  |             <ul> | ||||
|  |                <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Facilities With Charging Percentage.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Facility Lines in Floor Master.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Enables Separate Price in Floors Wise.</li> | ||||
|  |                 <li style="list-style:none !important;"><span style="color:green;"> ☑</span>   Simple Configuration.</li> | ||||
|  |             </ul> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <h3 class="oe_slogan">Facility Master - Tree View</h3> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_row_img oe_centered"> | ||||
|  |                 <img class="oe_picture oe_screenshot" src="1.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container"> | ||||
|  |     <h3 class="oe_slogan">Facility Master - Form View</h3> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <p> | ||||
|  |             <ul> | ||||
|  |                 <li>Facilities with its charging percentage.</li> | ||||
|  |                 <li>Images and bullet points of facility.</li> | ||||
|  |             </ul> | ||||
|  |         </p> | ||||
|  |     </div> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_row_img oe_centered"> | ||||
|  |                 <img class="oe_picture oe_screenshot" src="5.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <h3 class="oe_slogan">Floor Master With Facility Lines - Form View</h3> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <p> | ||||
|  |             <ul> | ||||
|  |                 <li>Facility lines with its charging percentage.</li> | ||||
|  |                 <li>User can alter its charges from this lines.</li> | ||||
|  |                 <li>Automated total affecting facility percentage of floor.</li> | ||||
|  |             </ul> | ||||
|  |         </p> | ||||
|  |     </div> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_row_img oe_centered"> | ||||
|  |                 <img class="oe_picture oe_screenshot" src="3.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container"> | ||||
|  |     <h3 class="oe_slogan">Floor Wise Price Change - POS Screen</h3> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <p> | ||||
|  |             <ul> | ||||
|  |                 <li>Floor facility charge will added with actual price of product.</li> | ||||
|  |             </ul> | ||||
|  |         </p> | ||||
|  |     </div> | ||||
|  |     <div class="oe_row oe_spaced"> | ||||
|  |         <div class="oe_span12"> | ||||
|  |             <div class="oe_row_img oe_centered"> | ||||
|  |                 <img class="oe_picture oe_screenshot" src="4.png"> | ||||
|  |             </div> | ||||
|  |         </div> | ||||
|  |     </div> | ||||
|  | </section> | ||||
|  | 
 | ||||
|  | <section class="oe_container oe_dark"> | ||||
|  |     <h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> | ||||
|  |     <div class="oe_slogan" style="margin-top:10px !important;"> | ||||
|  |         <a  class="btn btn-primary btn-lg mt8" | ||||
|  |             style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i | ||||
|  |             class="fa fa-envelope"></i> Email </a> <a | ||||
|  |             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | ||||
|  |             href="http://www.cybrosys.com/contact/"><i | ||||
|  |             class="fa fa-phone"></i> Contact Us </a> <a | ||||
|  |             class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" | ||||
|  |             href="http://www.cybrosys.com/odoo-customization-and-installation/"><i | ||||
|  |             class="fa fa-check-square"></i> Request Customization </a> | ||||
|  |     </div> | ||||
|  |             <img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> | ||||
|  | </section> | ||||
| @ -0,0 +1,20 @@ | |||||
|  | odoo.define('pos_restaurant_floor_facility.floor_facility_rate_addition', function (require) { | ||||
|  | 'use strict'; | ||||
|  | alert("aaaaaaaa"); | ||||
|  | var models = require('point_of_sale.models'); | ||||
|  | var screens = require('point_of_sale.screens'); | ||||
|  | var restaurant = require('pos_restaurant.floors'); | ||||
|  | 
 | ||||
|  | models.load_fields("restaurant.floor",['facility_service_percentage']); | ||||
|  | 
 | ||||
|  | screens.ProductScreenWidget.include({ | ||||
|  |     click_product: function(product) { | ||||
|  |                if(product.to_weight && this.pos.config.iface_electronic_scale){ | ||||
|  |                    this.gui.show_screen('scale',{product: product}); | ||||
|  |                }else{ | ||||
|  |                    this.pos.get_order().add_product(product,{ price: product.price + | ||||
|  |                    (product.price * this.pos.table.floor.facility_service_percentage)/100}); | ||||
|  |                } | ||||
|  |         } | ||||
|  | }); | ||||
|  | }); | ||||
| @ -0,0 +1,69 @@ | |||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  |         <record id="restaurant_extra_feature_form_view" model="ir.ui.view"> | ||||
|  |           <field name="name">Floor View Extra</field> | ||||
|  |           <field name="model">restaurant.floor</field> | ||||
|  |           <field name="inherit_id" ref="pos_restaurant.view_restaurant_floor_form"/> | ||||
|  |           <field name="arch" type="xml"> | ||||
|  |                 <xpath expr="//field[@name='background_color']" position="after"> | ||||
|  |                     <field name="facility_service_percentage"/> | ||||
|  |                 </xpath> | ||||
|  |                 <xpath expr="//field[@name='table_ids']" position="after"> | ||||
|  |                    <group col="1"> | ||||
|  |                         <field name="rest_floor_facility"> | ||||
|  |                             <tree string='Floor Facility' editable="bottom"> | ||||
|  |                                 <field name="name" /> | ||||
|  |                                 <field name="line_percentage" /> | ||||
|  |                             </tree> | ||||
|  |                         </field> | ||||
|  |                     </group> | ||||
|  |                 </xpath> | ||||
|  |           </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record id="extra_features_form_view" model="ir.ui.view"> | ||||
|  |             <field name="name">Floor Facility Form</field> | ||||
|  |             <field name="model">restaurant.floor.facility</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <form> | ||||
|  |                     <sheet> | ||||
|  |                         <group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="name"/> | ||||
|  |                             </group> | ||||
|  |                             <group> | ||||
|  |                                 <field name="percentage"/> | ||||
|  |                             </group> | ||||
|  |                         </group> | ||||
|  |                         <field name="description"/> | ||||
|  |                     </sheet> | ||||
|  |                 </form> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record id="extra_features_tree_view" model="ir.ui.view"> | ||||
|  |             <field name="name">Floor Facility Tree</field> | ||||
|  |             <field name="model">restaurant.floor.facility</field> | ||||
|  |             <field name="arch" type="xml"> | ||||
|  |                 <tree> | ||||
|  |                     <field name="name"/> | ||||
|  |                     <field name="percentage"/> | ||||
|  |                 </tree> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  | 
 | ||||
|  |         <record id="action_restaurant_extra_features" model="ir.actions.act_window"> | ||||
|  |             <field name="name">Floor Facility</field> | ||||
|  |             <field name="res_model">restaurant.floor.facility</field> | ||||
|  |             <field name="view_type">form</field> | ||||
|  |             <field name="view_mode">tree,form</field> | ||||
|  |             <field name="help" type="html"> | ||||
|  |                 <p class="oe_view_nocontent_create"> | ||||
|  |                     Click to add a new facility. | ||||
|  |                 </p> | ||||
|  |             </field> | ||||
|  |         </record> | ||||
|  |         <menuitem id="menu_restaurant_extra_features" name="Floor Facility"  sequence="31" parent="point_of_sale.menu_point_config_product" action="action_restaurant_extra_features"/> | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
| @ -0,0 +1,10 @@ | |||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||
|  | <odoo> | ||||
|  |     <data> | ||||
|  |         <template id="assets" inherit_id="point_of_sale.assets"> | ||||
|  |           <xpath expr="." position="inside"> | ||||
|  |               <script type="text/javascript" src="/pos_restaurant_floor_facility/static/src/js/facility_floor.js"></script> | ||||
|  |           </xpath> | ||||
|  |         </template> | ||||
|  |     </data> | ||||
|  | </odoo> | ||||
					Loading…
					
					
				
		Reference in new issue