Skip to content

Commit

Permalink
[FIX] resource_booking: inverse partner
Browse files Browse the repository at this point in the history
Set the inverse for partner_id so modules can adapt seamlessly to the
changes in OCA#110

TT45338
  • Loading branch information
chienandalu committed Nov 29, 2023
1 parent cbcb4c9 commit 781af1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resource_booking/models/resource_booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class ResourceBooking(models.Model):
partner_id = fields.Many2one(
comodel_name="res.partner",
compute="_compute_partner_id",
inverse="_inverse_partner_id",
readonly=False,
string="Requester",
)
partner_ids = fields.Many2many(
Expand Down Expand Up @@ -219,6 +221,10 @@ def _compute_partner_id(self):
for one in self:
one.partner_id = one.partner_ids[:1]

def _inverse_partner_id(self):
for one in self:
one.partner_ids = one.partner_id

@api.model
def _default_user_id(self):
return self.env.user
Expand Down

0 comments on commit 781af1d

Please sign in to comment.