Skip to content

[ADD] contract_sale_generation_payment_mode#1180

Open
victor-champonnois wants to merge 2 commits into
OCA:16.0from
coopiteasy:16.0-add-contract_sale_generation_payment_mode
Open

[ADD] contract_sale_generation_payment_mode#1180
victor-champonnois wants to merge 2 commits into
OCA:16.0from
coopiteasy:16.0-add-contract_sale_generation_payment_mode

Conversation

@victor-champonnois
Copy link
Copy Markdown
Member

@victor-champonnois victor-champonnois commented Jan 13, 2025

Set the payment mode from the contract on sales orders created by the contract.

@huguesdk huguesdk force-pushed the 16.0-add-contract_sale_generation_payment_mode branch from f17e393 to e05edeb Compare March 27, 2025 22:28
Copy link
Copy Markdown
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

lgtm! (amended some slight fixes to the commit.)

@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 27, 2025
@huguesdk
Copy link
Copy Markdown
Member

huguesdk commented Aug 4, 2025

@OCA/human-resources-maintainers could someone please review or merge this?

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 10, 2025
@rousseldenis rousseldenis added this to the 16.0 milestone Sep 15, 2025
@rousseldenis
Copy link
Copy Markdown
Contributor

@victor-champonnois Thanks for this. Maybe a little test ? Thanks

@victor-champonnois
Copy link
Copy Markdown
Member Author

@rousseldenis thanks, I've added some tests

@victor-champonnois victor-champonnois force-pushed the 16.0-add-contract_sale_generation_payment_mode branch 5 times, most recently from 5c52892 to 57c282d Compare September 18, 2025 07:42
@victor-champonnois
Copy link
Copy Markdown
Member Author

I don't manage to see why the codecov stays red, an idea on how to fix this ?
It states that these lines are not covered, but I don't see a way to cover them more than what I've already did. Can someone help ? :)

+         res = super()._prepare_recurring_sales_values(date_ref)
+         if res:
+             res[0]["payment_mode_id"] = self.payment_mode_id.id
+         return res

@huguesdk huguesdk force-pushed the 16.0-add-contract_sale_generation_payment_mode branch from ccf8251 to 57c282d Compare September 19, 2025 08:36
victor-champonnois and others added 2 commits September 19, 2025 12:26
tests should be tagged as post_install, as ContractSaleCommon sets up a
coa if none has been loaded.
@huguesdk huguesdk force-pushed the 16.0-add-contract_sale_generation_payment_mode branch from 57c282d to 3ae2ffe Compare September 19, 2025 10:46
@huguesdk
Copy link
Copy Markdown
Member

according to the logs and the coverage report, the test files are loaded, but the tests don’t run. those of contract_sale_generation don’t run either. this is due to a recent change in the tests of contract_sale_generation (in #1201). i fixed it in #1305 (and tagged the tests as post_install here also). i think the coverage will be fine as soon as #1305 is merged.

@victor-champonnois
Copy link
Copy Markdown
Member Author

many thanks @huguesdk !

@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 18, 2026
@huguesdk
Copy link
Copy Markdown
Member

@OCA/project-service-maintainers could someone please merge this?

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 25, 2026
Comment on lines +11 to +15
def _prepare_recurring_sales_values(self, date_ref=False):
res = super()._prepare_recurring_sales_values(date_ref)
if res:
res[0]["payment_mode_id"] = self.payment_mode_id.id
return res
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's fine, but it seems more consistent with the module's design to put this code in the _prepare_sale() method. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants