From 122afbce6546c572081990401fa382eb9a855191 Mon Sep 17 00:00:00 2001 From: oscar alvarez Date: Tue, 22 Mar 2022 14:25:49 -0500 Subject: [PATCH] Fix --- booking.py | 3 +-- channel.py | 6 ------ patch.sql | 4 ++++ 3 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 patch.sql diff --git a/booking.py b/booking.py index 2cf396f..8f6025c 100644 --- a/booking.py +++ b/booking.py @@ -154,7 +154,6 @@ class Booking(Workflow, ModelSQL, ModelView): @classmethod def __setup__(cls): super(Booking, cls).__setup__() - # ALTER TABLE hotel_booking RENAME COLUMN party_seller TO channel cls._order.insert(0, ('create_date', 'DESC')) cls._transitions |= set(( ('offer', 'confirmed'), @@ -815,7 +814,7 @@ class Booking(Workflow, ModelSQL, ModelView): def get_untaxed_amount(self, name): res = _ZERO for line in self.lines: - res += line.total_balance + res += line.total_amount return res # def get_occupancies(self, name): diff --git a/channel.py b/channel.py index ce9a96b..c3fe190 100644 --- a/channel.py +++ b/channel.py @@ -55,12 +55,6 @@ class SaleChannel(ModelSQL, ModelView): ('after_sale', 'After-Sale'), ], 'Collection Mode', required=False, help="Commission collection mode") - @classmethod - def __setup__(cls): - # alter table hotel_channel drop column commission; - # alter table hotel_channel drop column payment_method; - super(SaleChannel, cls).__setup__() - @staticmethod def default_company(): return Transaction().context.get('company') diff --git a/patch.sql b/patch.sql new file mode 100644 index 0000000..abf2bf1 --- /dev/null +++ b/patch.sql @@ -0,0 +1,4 @@ + +ALTER TABLE hotel_channel DROP COLUMN commission; +ALTER TABLE hotel_channel DROP COLUMN payment_method; +ALTER TABLE hotel_booking RENAME COLUMN party_seller TO channel;