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 + + + + + + + + + + diff --git a/icons/channel-despegar.svg b/icons/channel-despegar.svg new file mode 100644 index 0000000..99d7cbd --- /dev/null +++ b/icons/channel-despegar.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + diff --git a/icons/channel-expedia.svg b/icons/channel-expedia.svg new file mode 100644 index 0000000..708ded7 --- /dev/null +++ b/icons/channel-expedia.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + diff --git a/icons/channel-house.png b/icons/channel-house.png deleted file mode 100644 index f0e3b5a..0000000 Binary files a/icons/channel-house.png and /dev/null differ diff --git a/icons/channel-house.svg b/icons/channel-house.svg new file mode 100644 index 0000000..16ff1d7 --- /dev/null +++ b/icons/channel-house.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + diff --git a/icons/despegar.png b/icons/despegar.png deleted file mode 100644 index 6174dd2..0000000 Binary files a/icons/despegar.png and /dev/null differ diff --git a/icons/expedia.png b/icons/expedia.png deleted file mode 100644 index 6564fe7..0000000 Binary files a/icons/expedia.png and /dev/null differ diff --git a/view/booking_tree.xml b/view/booking_tree.xml index ead25aa..e76c794 100644 --- a/view/booking_tree.xml +++ b/view/booking_tree.xml @@ -2,12 +2,12 @@ - + - +