Skip to content

Commit

Permalink
shopinvader_api_address: support partial update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbeau committed Nov 2, 2023
1 parent 36179f0 commit 0f7434f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions shopinvader_api_address/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ class AddressUpdate(StrictExtendableBaseModel):
country_id: int | None = None

def to_res_partner_vals(self) -> dict:
vals = {
"name": self.name,
"street": self.street,
"street2": self.street2,
"zip": self.zip,
"city": self.city,
"phone": self.phone,
"email": self.email,
"state_id": self.state_id,
"country_id": self.country_id,
}

return vals
fields = [
"name",
"street",
"street2",
"zip",
"city",
"phone",
"email",
"state_id",
"country_id",
]
values = self.model_dump(exclude_unset=True)
return {f: values[f] for f in fields if f in values}


# --- Billing Address ---
Expand Down

0 comments on commit 0f7434f

Please sign in to comment.