Skip to content

Commit

Permalink
14.0 aldahotels refact multiproperties (#58)
Browse files Browse the repository at this point in the history
* [RFC]cash_daily_report: refact multiproperty features

* [RFC]kelly_daily_report: refact multiproperty features

* [RFC]pms_data_bi: refact multiproperty features

* [RFC]connector_docuware: refact multiproperty features

* [RFC]purchase_portal: refact multiproperty features
  • Loading branch information
DarioLodeiros authored Jan 30, 2025
1 parent 36fd889 commit 650a166
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cash_daily_report/wizard/cash_daily_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_default_date_end(self):
pms_property_id = fields.Many2one(
"pms.property",
string="Property",
default=lambda self: self.env.user.get_active_property_ids()[0],
default=lambda self: self.env.user.pms_property_id.id or False,
)

@api.model
Expand Down
1 change: 0 additions & 1 deletion connector_docuware/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
from . import docuware_cabinet
from . import docuware_document
from . import account_move
from . import res_users
3 changes: 0 additions & 3 deletions connector_docuware/models/res_users/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions connector_docuware/models/res_users/common.py

This file was deleted.

2 changes: 1 addition & 1 deletion kellys_daily_report/wizard/kellys_daily_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _get_default_habitaciones(self):
pms_property_id = fields.Many2one(
"pms.property",
string="Property",
default=lambda self: self.env.user.get_active_property_ids()[0],
default=lambda self: self.env.user.pms_property_id.id or False,
)

def calculate_report(self):
Expand Down
2 changes: 1 addition & 1 deletion pms_data_bi/models/budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ class Budget(models.Model):
"pms.property",
required=True,
ondelete="restrict",
default=lambda self: self.env.user.get_active_property_ids()[0],
default=lambda self: self.env.user.pms_property_id.id or False,
)
2 changes: 1 addition & 1 deletion purchase_portal/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def portal_my_new_purchase_requests_detail(self, purchase_request=None, access_t

values = self._purchase_request_get_page_view_values(purchase_request_sudo, access_token, **kw)

allowed_pms_property_ids = request.env.user.get_active_property_ids()
allowed_pms_property_ids = request.env.user.pms_property_ids.ids
if allowed_pms_property_ids:
allowed_pms_property_ids = request.env['pms.property'].browse(allowed_pms_property_ids).filtered(lambda x: x.company_id == request.env.company)

Expand Down

0 comments on commit 650a166

Please sign in to comment.