diff --git a/booking.py b/booking.py
index 8970b71..00c9844 100644
--- a/booking.py
+++ b/booking.py
@@ -219,12 +219,10 @@ class Booking(Workflow, ModelSQL, ModelView):
return config.payment_term.id
def get_channel_icon(self, name):
- # if self.channel:
- # return
- # path = os.path.join('icons/channel-house.png')
- # with file_open('icons/channel-house.png', mode='r', encoding='utf-8') as fp:
- # return fp.read()
- pass
+ name_icon = 'hotel-channel-house'
+ if self.channel and self.channel.code:
+ name_icon = f'hotel-channel-{self.channel.code}'
+ return name_icon
@classmethod
def trigger_create(cls, records):
@@ -792,11 +790,6 @@ class Booking(Workflow, ModelSQL, ModelView):
except:
pass
- # def add_payments_invoice(self):
- # for payment in self.payments:
- # for invoice in self.invoices:
- # if invoice.
-
@classmethod
def create_invoice(cls, folios):
pool = Pool()
diff --git a/channel.py b/channel.py
index 9a87cc2..747de22 100644
--- a/channel.py
+++ b/channel.py
@@ -22,7 +22,7 @@ class SaleChannel(ModelSQL, ModelView):
__name__ = 'hotel.channel'
name = fields.Char('Name', required=True)
code = fields.Selection([
- ('', ''),
+ (None, ''),
('booking', 'Booking'),
('despegar', 'Despegar'),
('expedia', 'Expedia'),
@@ -92,7 +92,6 @@ class SaleChannel(ModelSQL, ModelView):
return Company(company).currency.id
def compute(self, amount):
- print(self)
res = Decimal(round(float(amount) * self.commission / 100, 2))
return res
diff --git a/hotel.xml b/hotel.xml
index 0f82dc6..015f754 100644
--- a/hotel.xml
+++ b/hotel.xml
@@ -52,7 +52,19 @@ this repository contains the full copyright notices and license terms. -->
hotel-channel-house
- icons/channel-house.png
+ icons/channel-house.svg
+
+
+ hotel-channel-despegar
+ icons/channel-despegar.svg
+
+
+ hotel-channel-expedia
+ icons/channel-expedia.svg
+
+
+ hotel-channel-booking
+ icons/channel-booking.svg