diff --git a/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py b/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py index 0bc13b9c9..f1e764f62 100644 --- a/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py +++ b/pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py @@ -33,11 +33,12 @@ class FacilityRestaurant(models.Model): @api.multi @api.depends('rest_floor_facility') def onchange_rest_facility(self): - sum_of_percentage = 0.0 - if self.rest_floor_facility: - for records in self.rest_floor_facility: - sum_of_percentage += records.line_percentage - self.facility_service_percentage = sum_of_percentage + for rec in self: + sum_of_percentage = 0.0 + if rec.rest_floor_facility: + for records in rec.rest_floor_facility: + sum_of_percentage += records.line_percentage + rec.facility_service_percentage = sum_of_percentage class FacilityRestaurantLines(models.Model): diff --git a/pos_restaurant_floor_facility/static/description/banner.jpg b/pos_restaurant_floor_facility/static/description/banner.jpg index 8f4a5505c..a501ca611 100644 Binary files a/pos_restaurant_floor_facility/static/description/banner.jpg and b/pos_restaurant_floor_facility/static/description/banner.jpg differ diff --git a/pos_restaurant_floor_facility/static/src/js/facility_floor.js~ b/pos_restaurant_floor_facility/static/src/js/facility_floor.js~ new file mode 100644 index 000000000..a8d75d907 --- /dev/null +++ b/pos_restaurant_floor_facility/static/src/js/facility_floor.js~ @@ -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}); + } + } +}); +}); \ No newline at end of file