-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
[10.0][IMP] sale_commission: Add settlement lines' analysis views #216
[10.0][IMP] sale_commission: Add settlement lines' analysis views #216
Conversation
Have you seen the work about analysis done in 11.0/12.0? I think it's more interesting to backport it than to create a divergence in views/features that will difficult migration path. |
No i'm mostly using 10.0. Ok I'll take a look and backport a version for an easier migration path. 11.0 or 12.0? |
Thanks @pedrobaeza for the hint, I tried to have a more complete set of the new commits with As for this PR, I cherry-picked as you suggested. |
With no name, the link between Odoo field and SQL column can't be done. Fixes OCA#194
0c48524
to
b3dff5a
Compare
comodel_name='res.company', | ||
default=lambda self: self.env.user.company_id, | ||
required=True | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't company_id
be used in a record rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eLBati it could be added in order to add the 'automatic filtering' in multi-company environments but, as far as I know, it is not mandatory.
In particular, I added this field because it was necessary after the changes backported from v11 and there (https://github.com/OCA/commission/tree/11.0/sale_commission) I haven't found any record rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add that record rules for proper multi-company support, which is indeed a pending topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then I'll add them in a separate commit so we can easily forward port them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, great. You should put a migration scripts for emptying company_id
field for avoiding mis-behaviors when you have commissions in several companies, or even better, try an heuristic for deducing the company of each settlement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza emptying company_id
is not possible because it is required
, I'm trying to find the correct company for each settlement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza @eLBati I added the record rules and the migration scripts as you requested, please have a look, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing that the company is already present in 11.0:
company_id = fields.Many2one( |
88714d3
to
817b0e2
Compare
…after backporting from 11.0 Otherwise get this: commission/sale_commission/models/settlement.py", line 198, in _check_company if record.agent_line.company_id != record.company_id: AttributeError: 'account.invoice.line.agent' object has no attribute 'company_id'
817b0e2
to
12bc1f3
Compare
…for settlements and their lines, and for agent lines
12bc1f3
to
11688d4
Compare
…lated field to improve performance
d5e9178
to
eb85cff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@SimoRubi do you want to keep the last 3 commits separated?
Yes, in my opinion they refer to different improvements that might be forward ported more easily if they are separated commits |
/ocabot merge |
Rebased to ocabot-merge-pr-216-to-10.0-by-pedrobaeza-bump-no, awaiting test results. |
Merged at ff792d8. Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged on the main branch. |
Add menu item for analysis views: