Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] [17.0] hotel #207

Open
wants to merge 145 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
4699570
[PATCH 001/140] [IMP] Improve the module
May 22, 2012
179ddd6
[PATCH 002/140] [IMP] Improve the report and wizard code
May 23, 2012
da5a593
[PATCH 003/140] [FIX/REF]Fixed the issues given and refactored the code
May 25, 2012
924aebd
[PATCH 004/140] [FIX] Fixing rst typos to comply with new rst2html to…
nhomar Nov 23, 2012
f0beb6a
[PATCH 005/140] [FIX] Dependencies not necesary
nhomar Nov 23, 2012
f4462ab
[PATCH 006/140] [FIX] Taken off all broken views V7 do things better …
nhomar Nov 23, 2012
fa892f1
[PATCH 007/140] [trunk] type is not necesary anymore in views
nhomar Nov 23, 2012
5da0d1f
[PATCH 008/140] [IMP] becom app
nhomar Nov 24, 2012
55bc685
[PATCH 009/140] [ADD] Icon and statics folder
nhomar Nov 24, 2012
56aac23
[PATCH 010/140] mark modules as unported to v8
gurneyalex Oct 17, 2014
0a7ff20
[PATCH 011/140] [MOV] move addons out of __unported__ (they remain no…
sbidoul Oct 13, 2015
373922c
[PATCH 012/140] [MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
6aef83f
[PATCH 013/140] [MIG] Rename manifest files
pedrobaeza Oct 6, 2016
6820729
[PATCH 014/140] [ADD]To add migrated hotel module as per v10 standard.
KrishnaPrajapati-SerpentCS Jun 7, 2017
0e45958
[PATCH 015/140] [REM]Remove pricelist domain in hotel
KrishnaPrajapati-SerpentCS Jun 30, 2017
3bdca1b
[PATCH 016/140] Update __manifest__.py
JayVora-SerpentCS Oct 2, 2017
c70b383
[PATCH 017/140] Create README.rst
JayVora-SerpentCS Oct 2, 2017
3606a4a
[PATCH 018/140] [REF]
JayVora-SerpentCS Oct 3, 2017
5eb74d2
[PATCH 019/140] [REF] TRavis
JayVora-SerpentCS Oct 3, 2017
8244744
[PATCH 020/140] Allowed to change checkout date before the folio is s…
JayVora-SerpentCS Oct 3, 2017
bd35472
[PATCH 021/140] [IMP]Improved hotel module.
KrishnaPrajapati-SerpentCS Oct 24, 2017
494ff79
[PATCH 022/140] [REM]Remove unused field name.
KrishnaPrajapati-SerpentCS Oct 25, 2017
877c5d2
[PATCH 023/140] [ADD]Added Runbot link in readme.rst file.
KrishnaPrajapati-SerpentCS Oct 25, 2017
026ec69
[PATCH 024/140] [REM]Remove description tag in manifest file.
KrishnaPrajapati-SerpentCS Oct 25, 2017
9ee3e46
[PATCH 025/140] [IMP]Update domain in service lines in hotel.
KrishnaPrajapati-SerpentCS Oct 26, 2017
3e7bbd1
[PATCH 026/140] [IMP]Added testcases in test_hotel.py file and Remove…
KrishnaPrajapati-SerpentCS Oct 31, 2017
d7aea65
[PATCH 027/140] [ADD]Added images in description folder in hotel.
KrishnaPrajapati-SerpentCS Oct 31, 2017
254481c
[PATCH 028/140] [IMP]Added images in readme.rst file in hotel moduke.
KrishnaPrajapati-SerpentCS Oct 31, 2017
0d3d83f
[PATCH 029/140] [IMP]Improved testcases in hotel module.
KrishnaPrajapati-SerpentCS Nov 2, 2017
752050b
[PATCH 030/140] [FIX]Fix the travis error.
KrishnaPrajapati-SerpentCS Nov 2, 2017
b3340ab
[PATCH 031/140] [MIG] hotel: Migration to 11.0
KrishnaPrajapati-SerpentCS Apr 23, 2018
24b2f29
[PATCH 032/140] [FIX] minor change in Readme
serpentcs-dev1 Apr 23, 2018
cfc5d7d
[PATCH 033/140] [IMP]Added OCA in author in manifest file.
KrishnaPrajapati-SerpentCS Apr 23, 2018
e8abcee
[PATCH 034/140] [FIX] data tags
serpentcs-dev1 Jul 23, 2018
4401091
[PATCH 035/140] [FIX] cosmetic changes and travis
serpentcs-dev1 Jul 25, 2018
5c7bddf
[PATCH 036/140] [IMP] manifest and readme
serpentcs-dev1 Jul 26, 2018
23915d8
[PATCH 037/140] [IMP] improved code reqadibility and iterations in me…
serpentcs-dev1 Jul 31, 2018
fb07c78
[PATCH 038/140] [IMP] manifest
serpentcs-dev1 Jul 31, 2018
6dc7e97
[PATCH 039/140] [IMP]Made Changes in Code Readiblity
YogeshMahera-SerpentCS Aug 13, 2018
2f78f01
[PATCH 040/140] [IMP]Made Changes in Code Readiblity
YogeshMahera-SerpentCS Aug 13, 2018
164146b
[PATCH 041/140] Added translation using Weblate (French)
sbidoul Oct 20, 2018
24438c0
[PATCH 042/140] [MIG]Migarted Module v11: Hotel Reservation
YogeshMahera-SerpentCS Sep 27, 2018
c52bb03
[PATCH 043/140] [MIG]hotel: migrated v11 to v12
vimalpatelserpentcs Dec 20, 2018
846567c
[PATCH 044/140] [IMP]Hotel: Improvement menifest file and remove extr…
vimalpatelserpentcs Dec 26, 2018
261f085
[PATCH 045/140] [IMP]hotel: change year in hotel license file
vimalpatelserpentcs Dec 31, 2018
39207ab
[PATCH 046/140] Update translation files
oca-transbot Mar 3, 2019
b8db1ba
[PATCH 047/140] [MIG]hotel_housekeeping:Migrate v11 to v12
dhruvitaSerpentCS Mar 29, 2019
692db2a
[PATCH 048/140] [FIX] Remove branding
tarteo Apr 25, 2019
4581149
[PATCH 049/140] [IMP] hotel/hotel_reservation: Warnings was fixed
luistorresm May 4, 2019
8e426a4
[PATCH 050/140] [UPD] Update hotel.pot
oca-travis May 4, 2019
85cc134
[PATCH 051/140] Update translation files
oca-transbot May 20, 2019
b3b0d3d
[PATCH 052/140] [MIG]hotel_restaurant:Migrate from v11 to v12.
dhruvitaSerpentCS Apr 2, 2019
7d7597e
[PATCH 053/140] Translated using Weblate (Portuguese (Brazil))
Aug 30, 2019
9d032ea
[PATCH 054/140] Translated using Weblate (Portuguese (Brazil))
Sep 2, 2019
7c364b0
[PATCH 055/140] Translated using Weblate (Portuguese (Brazil))
Sep 2, 2019
0985a05
[PATCH 056/140] Translated using Weblate (Portuguese (Brazil))
Sep 17, 2019
cd1f0fc
[PATCH 057/140] Added translation using Weblate (Chinese (Simplified))
liweijie0812 Oct 16, 2019
542fdc0
[PATCH 058/140] [FIX-Issue] Fixed Error issue-#84
nikul-serpentcs Dec 9, 2019
09a9be5
[PATCH 059/140] [FIX] Fixed Error
nikul-serpentcs Dec 9, 2019
e852a75
[PATCH 060/140] [MIG]hotel:migrated hotel from v12 to v13.
dhruvitaSerpentCS Jul 2, 2020
f2d3e7a
[PATCH 061/140] [IMP]hotel:Optimised code.
dhruvitaSerpentCS Jul 6, 2020
c458040
[PATCH 062/140] [IMP]hotel:Optimised code
dhruvitaSerpentCS Jul 6, 2020
d5de5ea
[PATCH 063/140] [IMP]hotel:optimised code.
nikitavaghela Sep 10, 2020
12fa3f8
[PATCH 064/140] [IMP]hotel:Optimised code.
nikitavaghela Sep 11, 2020
cd1193e
[PATCH 065/140] [UPD] Update hotel.pot
oca-travis Sep 11, 2020
e6e68c4
[PATCH 066/140] [IMP]hotel:Improved code and fields name in hotel.
dhruvitaSerpentCS Sep 21, 2020
02d1acf
[PATCH 067/140] [IMP]hotel,hotel_reservation:Improved code.
dhruvitaSerpentCS Sep 23, 2020
ec09671
[PATCH 068/140] Update translation files
oca-transbot Sep 23, 2020
e80ab8e
[PATCH 069/140] [IMP]hotel:Improved code.
dhruvitaSerpentCS Oct 23, 2020
1d01ae2
[PATCH 070/140] [UPD] Update hotel.pot
oca-travis Oct 24, 2020
09abc1e
[PATCH 071/140] Update translation files
oca-transbot Oct 24, 2020
275ea78
[PATCH 072/140] [IMP]Improved README.rst.
dhruvitaSerpentCS Oct 29, 2020
9b1163b
[PATCH 073/140] [UPD] Update hotel.pot
oca-travis Oct 29, 2020
ef6dc7c
[PATCH 074/140] Update translation files
oca-transbot Oct 29, 2020
9e2d3a4
[PATCH 075/140] [FIX]hotel:Fixed issue.
dhruvitaSerpentCS Dec 9, 2020
224abb8
[PATCH 076/140] [MIG][14.0] Migrate Module v14.
maitripatel19 May 18, 2021
3ac8360
[PATCH 077/140] [FIX]hotel: fixed the travis error
vimalpatelserpentcs Jun 4, 2021
e44e6ce
[PATCH 078/140] [FIX]hotel: fixed runbot error(log warnings)
vimalpatelserpentcs Jun 4, 2021
5dc6edc
[PATCH 079/140] [14.0][FIX] hotel:Fixed issue
maitripatel19 Jun 28, 2021
3e0ab84
[PATCH 080/140] [14.0][FIX] hotel:Fixed Issues.
maitripatel19 Jun 28, 2021
7530e1f
[PATCH 081/140] [IMP]hotel: improved the code and fixed issue
vimalpatelserpentcs Jul 2, 2021
56cd5ac
[PATCH 082/140] [14.0][IMP] Hotel: Improved code for hotel module
Rajan-SerpentCS Jul 19, 2021
7bb6274
[PATCH 083/140] [14.0][MIG] hotel_restaurant: Migrated to v14
Rajan-SerpentCS Aug 9, 2021
ba238a9
[PATCH 084/140] [FIX] hotel: Fixed issue in hotel folio report
Rajan-SerpentCS Aug 9, 2021
1abccd4
[PATCH 085/140] [MIG] hotel: Migration to 15.0
fetcheping Jan 5, 2022
49ce808
[PATCH 086/140] [UPD] README.rst
OCA-git-bot Jan 28, 2022
1409b5c
[PATCH 087/140] [UPD] Update hotel.pot
Jan 28, 2022
6c9d4ff
[PATCH 088/140] Added translation using Weblate (Italian)
mymage Oct 31, 2022
813f13c
[PATCH 089/140] [UPD] Update hotel.pot
Oct 31, 2022
688b6e2
[PATCH 090/140] Translated using Weblate (Italian)
mymage Oct 31, 2022
0aa4be0
[PATCH 091/140] Update translation files
weblate Oct 31, 2022
f6fad13
[PATCH 092/140] Translated using Weblate (Italian)
mymage Oct 31, 2022
69a10db
[PATCH 093/140] Translated using Weblate (Italian)
mymage Nov 2, 2022
b83ce2d
[PATCH 094/140] Translated using Weblate (Italian)
mymage Nov 7, 2022
a60279b
[PATCH 095/140] Translated using Weblate (Italian)
mymage Nov 16, 2022
0bfd5cb
[PATCH 096/140] Translated using Weblate (Italian)
mymage Nov 21, 2022
76f787f
[PATCH 097/140] Translated using Weblate (Italian)
mymage Nov 28, 2022
996459f
[PATCH 098/140] Translated using Weblate (Italian)
mymage Dec 23, 2022
c37ae37
[PATCH 099/140] Translated using Weblate (Italian)
mymage Dec 27, 2022
2db8534
[PATCH 100/140] Translated using Weblate (Italian)
mymage Dec 28, 2022
64a4d28
[PATCH 101/140] Translated using Weblate (Italian)
francesco-ooops Dec 29, 2022
f12d2cc
[PATCH 102/140] Translated using Weblate (Italian)
francesco-ooops Dec 30, 2022
b96c2cb
[PATCH 103/140] Translated using Weblate (Italian)
francesco-ooops Jan 2, 2023
629e48b
[PATCH 104/140] Translated using Weblate (Italian)
francesco-ooops Jan 2, 2023
2f7aac8
[PATCH 105/140] Translated using Weblate (Italian)
francesco-ooops Jan 3, 2023
2093bf8
[PATCH 106/140] Translated using Weblate (Italian)
francesco-ooops Jan 18, 2023
f527595
[PATCH 107/140] Translated using Weblate (Italian)
francesco-ooops Jan 26, 2023
b238587
[PATCH 108/140] Translated using Weblate (Italian)
mymage Feb 14, 2023
56b755e
[PATCH 109/140] [FIX] [15.0] hotel: fix license
ShwetaSerpentCS Mar 3, 2023
9590f56
[PATCH 110/140] Translated using Weblate (Italian)
francesco-ooops Mar 20, 2023
9cb6f03
[PATCH 111/140] Translated using Weblate (Italian)
mymage Mar 23, 2023
370b079
[PATCH 112/140] Translated using Weblate (Italian)
mymage Apr 5, 2023
16066f6
[PATCH 113/140] Translated using Weblate (Italian)
francesco-ooops Apr 7, 2023
e86d464
[PATCH 114/140] Translated using Weblate (Italian)
mymage Apr 12, 2023
2d3b892
[PATCH 115/140] Translated using Weblate (Italian)
mymage Apr 21, 2023
944f16d
[PATCH 116/140] Translated using Weblate (Italian)
francesco-ooops Apr 26, 2023
353962b
[PATCH 117/140] Translated using Weblate (Italian)
mymage May 3, 2023
8f84bd4
[PATCH 118/140] Translated using Weblate (Italian)
mymage May 3, 2023
3195172
[PATCH 119/140] Translated using Weblate (Italian)
mymage May 9, 2023
4c8f5e9
[PATCH 120/140] Translated using Weblate (Italian)
mymage May 10, 2023
dd84425
[PATCH 121/140] Translated using Weblate (Italian)
mymage May 11, 2023
ad247d9
[PATCH 122/140] Translated using Weblate (Italian)
mymage May 12, 2023
6b35844
[PATCH 123/140] Translated using Weblate (Italian)
francesco-ooops May 12, 2023
b68ec8c
[PATCH 124/140] Translated using Weblate (Italian)
francesco-ooops May 16, 2023
5e7d434
[PATCH 125/140] Translated using Weblate (Italian)
francesco-ooops May 17, 2023
57e862b
[PATCH 126/140] Translated using Weblate (Italian)
mymage Jun 7, 2023
2d7bed7
[PATCH 127/140] Translated using Weblate (Italian)
mymage Jun 9, 2023
cd1b3fb
[PATCH 128/140] Translated using Weblate (Italian)
mymage Jun 12, 2023
a520967
[PATCH 129/140] Translated using Weblate (Italian)
mymage Jun 30, 2023
9da4728
[PATCH 130/140] Translated using Weblate (Italian)
francesco-ooops Jul 10, 2023
3afd083
[PATCH 131/140] Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
a8f35c5
[PATCH 132/140] Translated using Weblate (Italian)
francesco-ooops Jul 17, 2023
8045135
[PATCH 133/140] Translated using Weblate (Italian)
francesco-ooops Jul 25, 2023
b0f3a84
[PATCH 134/140] [UPD] README.rst
OCA-git-bot Sep 3, 2023
6220591
[PATCH 135/140] Translated using Weblate (Italian)
mymage Aug 22, 2023
e29c872
[PATCH 136/140] Translated using Weblate (Italian)
mymage Sep 4, 2023
6a1598d
[PATCH 137/140] Translated using Weblate (Italian)
mymage Sep 13, 2023
c02ed49
[PATCH 138/140] Translated using Weblate (Italian)
mymage Sep 21, 2023
bb00d05
[PATCH 139/140] [16.0][FIX] Travis
sachin-serpentcs Sep 29, 2023
01bd487
[PATCH 140/140] [16.0][MIG] hotel
sachin-serpentcs Sep 29, 2023
2f4b970
[MIG] Migrated hotel module in v17.
Rajan-SCS Apr 23, 2024
abed0a6
[IMP] [17.0] hotel: Implement code changes as per review comments
pavan-serpentcs Jul 15, 2024
9f7223f
[IMP] [17.0] hotel: Implement code changes as per review comments
pavan-serpentcs Jul 16, 2024
4dee427
[IMP] [17.0] hotel: Resolve pre-commit errors
pavan-serpentcs Jul 18, 2024
236a3b3
[IMP] [17.0] hotel: Check and Update Test Cases
pavan-serpentcs Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hotel/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
{
"name": "Hotel Management",
"version": "17.0.1.0.0",
"author": "Odoo Community Association (OCA), Serpent Consulting \
Services Pvt. Ltd., OpenERP SA",
"author": """Odoo Community Association (OCA),
Serpent Consulting Services Pvt. Ltd.,
""",
"category": "Hotel Management",
"website": "https://github.com/OCA/vertical-hotel",
"depends": ["sale_stock", "account"],
Expand Down
1 change: 1 addition & 0 deletions hotel/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class AccountMove(models.Model):
_inherit = "account.move"

# "Override the create method to link the account move with a hotel folio"
@api.model
def create(self, vals):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Docstring
"Override the create method to link the account move with a hotel folio"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added comment instead of docstring:
Docstring is the method description defined inside the method between triple quote in case of multiline

@api.model
def create(self, vals):
    "Override the create method to link the account move with a hotel folio"
     

res = super().create(vals)
Expand Down
42 changes: 20 additions & 22 deletions hotel/models/hotel_folio.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ class HotelFolio(models.Model):
_description = "hotel folio"
_rec_name = "order_id"

def name_get(self):
def _compute_display_name(self):
res = []
fname = ""
for rec in self:
if rec.order_id:
fname = str(rec.name)
rec.display_name = ( str(rec.order_id.name))
res.append((rec.id, fname))
return res

@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
Expand All @@ -58,7 +57,7 @@ def _get_checkout_date(self):
)
return fields.Datetime.to_string(checkout_date)

name = fields.Char("Folio Number", readonly=True, index=True, default="New")
name = fields.Char("Folio Number", index=True, default="New")
order_id = fields.Many2one(
"sale.order", "Order", delegate=True, required=True, ondelete="cascade"
)
Expand All @@ -69,7 +68,6 @@ def _get_checkout_date(self):
)
checkout_date = fields.Datetime(
"Check Out",
required=True,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed the required=True?

readonly=True,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default=_get_checkout_date,
)
Expand Down Expand Up @@ -140,18 +138,16 @@ def _update_folio_line(self, folio_id):
folio_room_line_obj = self.env["folio.room.line"]
hotel_room_obj = self.env["hotel.room"]
for rec in folio_id:
for room_rec in rec.room_line_ids:
room = hotel_room_obj.search(
[("product_id", "=", room_rec.product_id.id)]
)
room.write({"isroom": False})
vals = {
"room_id": room.id,
"check_in": rec.checkin_date,
"check_out": rec.checkout_date,
"folio_id": rec.id,
}
folio_room_line_obj.create(vals)
product_ids = rec.room_line_ids.mapped("product_id").ids
rooms = hotel_room_obj.search([("product_id", "in", product_ids)])
rooms.write({"isroom": False})
vals = {
"room_id": rooms.id,
"check_in": rec.checkin_date,
"check_out": rec.checkout_date,
"folio_id": rec.id,
}
folio_room_line_obj.create(vals)

@api.model
def create(self, vals):
Expand All @@ -161,7 +157,7 @@ def create(self, vals):
@param vals: dictionary of fields value.
@return: new record set for hotel folio.
"""
if not "service_line_ids" and "folio_id" in vals:
if "service_line_ids" not in vals and "folio_id" in vals:
tmp_room_lines = vals.get("room_line_ids", [])
vals["order_policy"] = vals.get("hotel_policy", "manual")
vals.update({"room_line_ids": []})
Expand All @@ -175,7 +171,7 @@ def create(self, vals):
vals = {}
vals["name"] = self.env["ir.sequence"].next_by_code("hotel.folio")
vals["duration"] = vals.get("duration", 0.0) or vals.get("duration", 0.0)
folio_id = super().create(vals)
folio_id = super(HotelFolio, self).create(vals)
self._update_folio_line(folio_id)
return folio_id

Expand All @@ -198,8 +194,8 @@ def write(self, vals):
new_rooms = set(room_lst).difference(set(rooms_list))
if len(list(new_rooms)) != 0:
room_list = product_obj.browse(list(new_rooms))
for rm in room_list:
room_obj = hotel_room_obj.search([("product_id", "=", rm.id)])
for room in room_list:
room_obj = hotel_room_obj.search([("product_id", "=", room.id)],limit=1)
room_obj.write({"isroom": False})
vals = {
"room_id": room_obj.id,
Expand All @@ -223,7 +219,7 @@ def write(self, vals):
[("folio_id", "=", rec.id)]
)
folio_romline_rec.write(room_vals)
return super().write(vals)
return super(HotelFolio, self).write(vals)

@api.onchange("partner_id")
def _onchange_partner_id(self):
Expand Down Expand Up @@ -347,6 +343,8 @@ def unlink(self):
@param self: The object pointer
@return: True/False.
"""
hotel_room_obj = self.env["hotel.room"]
hotel_room_line_obj = self.env["folio.room.line"]
for line in self:
if line.order_line_id:
rooms = self.env["hotel.room"].search(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define all object at starting of the method

Expand Down
4 changes: 2 additions & 2 deletions hotel/views/hotel_folio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<sheet>
<label for="name" string="Folio Number" />
<h1>
<field name="name" colspan="4" />
<field name="name" colspan="4" readonly="1" />
</h1>
<group colspan="4" col="4">
<field name="date_order" readonly="1" />
Expand Down Expand Up @@ -100,7 +100,7 @@
/>
<field
name="checkout_date"
readonly="state != 'draft'"
readonly="state != 'draft' or 1"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure its working?

/>
<field name="duration" readonly="1" />
<field name="duration_dummy" invisible="1" />
Expand Down
Loading