Browse Source

[FIX] Error Fixed: Onchange Problem

pull/29/head
SHEREEF PT 8 years ago
parent
commit
f9a025344b
  1. 11
      pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py
  2. BIN
      pos_restaurant_floor_facility/static/description/banner.jpg
  3. 20
      pos_restaurant_floor_facility/static/src/js/facility_floor.js~

11
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):

BIN
pos_restaurant_floor_facility/static/description/banner.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 197 KiB

20
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});
}
}
});
});
Loading…
Cancel
Save