Browse Source

[CHNG]Changed Depends

pull/29/head
SHEREEF PT 8 years ago
parent
commit
497382d52f
  1. 2
      pos_restaurant_floor_facility/__manifest__.py
  2. 14
      pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py

2
pos_restaurant_floor_facility/__manifest__.py

@ -22,7 +22,7 @@
##############################################################################
{
'name': 'Floor Wise Charge in Restaurant',
'version': '10.0.1.0.0',
'version': '10.0.2.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',

14
pos_restaurant_floor_facility/models/pos_restaurant_extra_facility.py

@ -28,14 +28,16 @@ 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)
facility_service_percentage = fields.Float(compute='onchange_rest_facility', string="Active Facility Charge %")
@api.onchange('rest_floor_facility')
def onchange_facility(self):
@api.multi
@api.depends('rest_floor_facility')
def onchange_rest_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
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
class FacilityRestaurantLines(models.Model):

Loading…
Cancel
Save