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

T1721 - Generate gift wizard uses the wrong partner #240

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
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: 4 additions & 1 deletion recurring_contract/models/contract_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def _build_invoice_gen_data(self, invoicing_date, invoicer, gift_wizard=False):
# between all the contracts of the list
contract = self.active_contract_ids[0]
company_id = contract.company_id.id
partner_id = self.partner_id.id
partner_id = self._get_partner_for_contract(contract).id
journal = self.env["account.journal"].search(
[("type", "=", "sale"), ("company_id", "=", company_id)], limit=1
)
Expand Down Expand Up @@ -563,3 +563,6 @@ def _updt_invoices_cg(self, vals):
# In case the advance_billing_months is greater than before
# we should generate more invoices
self.active_contract_ids.button_generate_invoices()

def _get_partner_for_contract(self, contract):
return contract.partner_id
Loading