-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
9.0 Port account_cutoff_base and account_cutoff_prepaid #37
Conversation
Extract a new module account_invoice_start_end_dates from account_cutoff_prepaid
And of course, this PR is also a port to the new API. |
@adrienpeiffer I don't see the pull request you told me about... |
[ADD] Add some hooks that are in 8.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.
👍 Code review and functional test
@chrisdec do you have a moment to test it on runbot ? 😄 |
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 review, no test.
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.
Several change across full code
|
||
@api.model | ||
def _inherit_default_cutoff_account_id(self): | ||
'''Function designed to be inherited by other cutoff 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.
Docstrings should use double triple-quota (applicable to all)
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.
If docstring should really use double triple-quota, then why flake8/pylint says nothing about it ?
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, good point. We need to add that check. But you can see here that what I say is correct: https://www.python.org/dev/peps/pep-0257/#id15 (For consistency, always use """triple double quotes""" around docstrings. Use r"""raw triple double quotes""" if you use any backslashes in your docstrings. For Unicode docstrings, use u"""Unicode triple-quoted strings""" .
)
movelines_to_create.append((0, 0, vals)) | ||
amount_total += amount | ||
|
||
# add contre-partie |
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.
counter-part
</data> | ||
</openerp> | ||
<odoo> | ||
<data noupdate="1"> |
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.
Put directly <odoo noupdate="1">
--> | ||
|
||
<openerp> | ||
<odoo> | ||
<data> |
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 can remove <data>
tag
<field name="cutoff_journal_id"/> | ||
<field name="cutoff_account_id"/> | ||
<field name="move_label"/> | ||
<field name="cutoff_journal_id" required="1"/> |
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 this be put (required flag) at field level?
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.
It is set at view level because it is inherited in the module account_cutoff_prepaid and replaced by attrs = {'required': [('forecast', '=', False)]}
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, thanks for the explanation. A comment in the XML would save this question for future readers of the code.
@@ -6,8 +6,8 @@ msgid "" | |||
msgstr "" |
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.
Remove POT file
--> | ||
|
||
<odoo> | ||
<data> |
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.
Remove <data>
tag
_inherit = 'account.invoice' | ||
|
||
def inv_line_characteristic_hashcode(self, invoice_line): | ||
'''Add start and end dates to hashcode used when the option "Group |
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.
Double quote
Hello, Functional test : Just one note : is it possible to show the message "Don't forget to Re-Generate Lines after entering or leaving forecast mode." only when user actives or disables the checkbox "forecast"? It's quite confusing to have this message when you open a new prepaid expense or a new prepaid revenue. Except that, 👍 |
Use triple double quotes for docstring Replace <openerp> by <odoo> in XML Remove <data> tags in XML Remove POT files
@chrisdec Yes, we need to find a better way. I guess a better way would be to use a button to enter/leave forecast mode (like the "Active" button on partners for example) and delete all lines when the user clicks on this button. I'll try to find time to do that... |
Extract a new module account_invoice_start_end_dates from account_cutoff_prepaid
Warning: it is not a port of the OCA/account-closing/8.0 version of the module, but a port of my LP branch https://code.launchpad.net/~akretion-team/account-closing/80-forecast-prepaid which is still the branch I use for Odoo v8 (which explains why I wasn't active on OCA/account-closing so far). This is due to the fact that my "forecast" branches were not merged on LP before the transition to github.
So the next step is to merge the few enhancements that took place in the OCA version of the module.