-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
[16.0][MIG] account_credit_control #268
[16.0][MIG] account_credit_control #268
Conversation
7c6023d
to
63d001d
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.
There's an error when you try to get into the partner (no matter if it's a customer or vendor).
The error code:
`Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1584, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 134, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1613, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1810, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 149, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 699, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 457, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 430, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/models.py", line 1605, in name_search
ids = self._name_search(name, args, operator, limit=limit)
File "/opt/odoo/odoo/models.py", line 1624, in _name_search
return self._search(args, limit=limit, access_rights_uid=name_get_uid)
File "/opt/odoo/odoo/models.py", line 4624, in _search
query = self._where_calc(domain)
File "/opt/odoo/odoo/models.py", line 4392, in _where_calc
return expression.expression(domain, self).query
File "/opt/odoo/odoo/osv/expression.py", line 447, in init
self.parse()
File "/opt/odoo/odoo/osv/expression.py", line 849, in parse
ids2 = comodel._name_search(right, domain or [], op2, limit=None)
File "/opt/odoo/addons/account/models/account_account.py", line 580, in _name_search
return self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid)
File "/opt/odoo/odoo/models.py", line 4624, in _search
query = self._where_calc(domain)
File "/opt/odoo/odoo/models.py", line 4392, in _where_calc
return expression.expression(domain, self).query
File "/opt/odoo/odoo/osv/expression.py", line 447, in init
self.parse()
File "/opt/odoo/odoo/osv/expression.py", line 1024, in parse
expr, params = self.__leaf_to_sql(leaf, model, alias)
File "/opt/odoo/odoo/osv/expression.py", line 1100, in __leaf_to_sql
raise ValueError("Invalid domain term %r" % (leaf,))
ValueError: Invalid domain term ('name', 'in', 'property_account_receivable_id')
The above server error caused the following client error:
null`
71ff07b
to
11a8a60
Compare
Thank you @Bearnard21, should be working now |
11a8a60
to
4032416
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.
Hi @astirpe, i just added some comments, feel free to discuss with me bout them.
Thank you,
to_add, to_remove = self._get_partner_related_lines(credit_control_run) | ||
lines = (lines | to_add) - to_remove | ||
to_add, to_remove = self._get_invoice_related_lines(credit_control_run) | ||
lines = (lines | to_add) - to_remove |
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.
Because all invoice lines must be for a particular company. I cannot find the case where (lines | to_add)
!= lines
.
I mean that we don't need to_add
in both cases _get_partner_related_lines
and _get_invoice_related_lines
.
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 tend to agree with you, but I don't know why this part was implemented this way. Maybe to allow _get_partner_related_lines
and _get_invoice_related_lines
to be extended by extra modules?
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.
Yes, maybe. So, just let to_add = self.env["account.move.line"]
in def _move_lines_subset()
Extended modules will update it then
account_credit_control/security/acl_account_credit_control_analysis.xml
Outdated
Show resolved
Hide resolved
account_credit_control/security/acl_res_partner_payment_action_type.xml
Outdated
Show resolved
Hide resolved
</field> | ||
</record> | ||
<!-- for button --> | ||
<record id="action_wizard_credit_policy_changer" model="ir.actions.act_window"> |
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.
cannot find a menu call this action
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.
Me neither, I'm trying to understand how was this originally supposed to work
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.
You should add a new menu to call this action, or delete it.
* Modify scenarios to be compatible with python scenarios * Voucher/statement related steps * Deprecated step implementation * Print report generation * All tests green * Mail + print of reminder * Broken translations
* Fix failure to confirm invoice when both account_credit_control and account_constraints are installed * use except_orm instead of except_osv * reindent code * Cleanup * use of deprecated field user_email causes permission error in multicompany setting fixed by using the correct 'email' field in the template
* Address in mako template to make sure address is displayed * Remove 'more info here' from report * Add some css to reminder report and set texts taking the whole width of the document * Add a subject in reminder report
* Report use precise mode by default * date_entry fields on line model to be used by report or in next MP on filter group by * reporting layer, + add hook function to get contact address * credit control mail are not in plain text but send as attachement * policy level name is now translatable as it is use in report and mail * permission on invoices because onetomany widget load data even if hidden ... * translation files + lang source * french translation
* Translation + report invoice address layout * Label Force credit control policy + french translation
…when partners or accounts are duplicated
…e in non draft state before deleting it
* pep8 (space after comma, reduced length of lines) * does not need to check if there is ids before calling unlink, it will return early * remove unused import * 'raise a new invoice' is a British English expression for 'issue a new invoice'
…ranslation extraction
* scenarios: We fix year of scenario on 2013 to have reproducable setup, and ensure test maintnability. The credit control scenarios are based on base_finance setup scenario provided in the project OpenERP Scenarios. This setup provide a financial setup for 2012 2013. We also fix some value as precision computation has been improved in OpenERP. * bug 1287072 Level calculation error if previous credit line is ignored * unifing wizard views to respect UI guide lines * credit control policy changer. Add a wizard on Invoice that will add a credit line and deprecate exisiting one on the invoice * test to ensure that wizard run on customer invoice * Scenario that test coherence of credit run after manually altering an invoice level * multicurrency in communication * ...
…ding _unported suffix
9994273
to
0d1e8c4
Compare
@nguyenminhchien regarding the two points left, I understand your proposal but I'm not yet fully convinced I want to change that part of code. Maybe the authors of that part could join the discussion, but for the time being I would leave it as it is, since this PR was meant to be a pure module migration. Do you mind to let the discussion continue on a separate PR once this one is merged? |
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.
@astirpe: it's ok
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.
Code LGTM
Please, cherry-pick #279 to commit history |
|
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.
Credit control policy level form check
- A check is performed after all policy levels were added to the credit control policy form. In case you've missed the custom mail message field in any of the credit control policy levels, you will get a warning on saving the whole policy. If there are several levels that were added, it's pretty inconvenient to check all the policy levels to find the missing field, so it would be nice if a check will be performed right on the policy level form.
- In case you've chosen phone call action, you still have to fill mandatory e-mail template field.
- If you're making changes in created policy level (eg. changing the channel from phone to e-mail), checking on the custom mail message field is not performed.
@Bearnard21 I see. Point 1 and 3 are something related to a common issue of HTML fields, so I don't think there's a quick way to fix it within this PR. I found an old discussion where this issue is explained more in details: https://www.odoo.com/forum/help-1/how-to-make-a-html-field-mandatory-in-the-form-161104 For point 2 I agree that it's something should be fixed, but is a problem already existing in previous versions of this module, so I think it's better to open a dedicated issue for that. What do you think? |
Sorry for replying late, |
@Bearnard21 please go ahead and open a PR to fix your points on previous versions. I will cherry pick your fixes to include them in this PR. 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.
Changes requested to be commited in next PR
This PR has the |
1 similar comment
This PR has the |
merge? |
/ocabot migration account_credit_control |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at cc55cd4. Thanks a lot for contributing to OCA. ❤️ |
action_name = "account_credit_control.credit_control_line_action" | ||
action = self.env.ref(action_name) | ||
action = action.read()[0] |
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.
This will raise AccessError
for anyone not member of Settings/Administration group. Proper way to do it is:
action_name = "account_credit_control.credit_control_line_action"
action = self.env["ir.actions.act_window"]._for_xml_id(action_name)
That seems to be missing in the migration guide actually 😕
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.
Thank you! I opened #287
Continue from #242