From 0e2fd7933c3d41f7d018e185daced787dbc06e65 Mon Sep 17 00:00:00 2001 From: oscar alvarez Date: Wed, 5 Oct 2022 21:42:21 -0500 Subject: [PATCH] Minor fix --- patch.sql | 8 ++++++++ statement.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/patch.sql b/patch.sql index 13ea5b1..b42df2e 100644 --- a/patch.sql +++ b/patch.sql @@ -3,3 +3,11 @@ 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; UPDATE hotel_folio SET nights_quantity=(departure_date-arrival_date) + + +UPDATE account_statement_line SET source=t.booking FROM ( + SELECT account_statement_line.id AS lid, 'hotel.booking,' || hfst.booking AS booking + FROM account_statement_line + INNER JOIN hotel_booking_statement_line_rel AS hfst + ON hfst.statement_line=account_statement_line.id) AS t + WHERE t.lid=account_statement_line.id; diff --git a/statement.py b/statement.py index 6727523..605be74 100644 --- a/statement.py +++ b/statement.py @@ -17,6 +17,13 @@ from trytond.report import Report class StatementLine(metaclass=PoolMeta): __name__ = 'account.statement.line' + @classmethod + def __setup__(cls): + super(StatementLine, cls).__setup__() + cls.amount.states = { + 'readonly': True + } + @classmethod def _get_source(cls): return super(StatementLine, cls)._get_source() + [