OCA / account-financial-tools

Odoo Accountant Financial Tools and Utils
GNU Affero General Public License v3.0
300 stars 741 forks source link

[16.0][IMP] account_loan: add multi-company ir_rule for 'account_loan_line' #1816

Closed AnizR closed 5 months ago

AnizR commented 5 months ago

This is a small fix: There is already a multi-company ir.rule on account loan but none on account loan line.

For the moment, it is not possible for a user to access loans of companies to which he hasn't access but, he can see lines of those loans!

OCA-git-bot commented 5 months ago

Hi @etobella, some modules you are maintaining are being modified, check this out!

etobella commented 5 months ago

I think you need to add a store True here in order to make it work

https://github.com/OCA/account-financial-tools/blob/16.0/account_loan/models/account_loan_line.py#L29

Anyway, it looks as a good idea. Thanks

AnizR commented 5 months ago

I think you need to add a store True here in order to make it work

https://github.com/OCA/account-financial-tools/blob/16.0/account_loan/models/account_loan_line.py#L29

Anyway, it looks as a good idea. Thanks

Thanks for your kick response! I have tested it locally and no, the "store=True" is not needed :smile:

If you want a similar example in Odoo: hr_payroll/hr_paysli_line.py> company_id = fields(..related...) and it is not stored and there is an ir_rule

etobella commented 5 months ago

I know it is not needed, but it is less eficient.

AnizR commented 5 months ago

I know it is not needed, but it is less eficient.

Ok, thanks for your advice, I changed my code. I didn't understand that it was an efficiency concern.

OCA-git-bot commented 5 months ago

What a great day to merge this nice PR. Let's do it! Prepared branch 16.0-ocabot-merge-pr-1816-by-etobella-bump-patch, awaiting test results.

OCA-git-bot commented 5 months ago

Congratulations, your PR was merged at d0b241f9cd78916694e22480acade040ef8d1e51. Thanks a lot for contributing to OCA. ❤️