-
-
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
11.0 mig account_cutoff_prepaid #60
Conversation
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.
pls squash translations commits all in one and include base PRs into oca_dependencies.txt to fix the build
@@ -0,0 +1,27 @@ | |||
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
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.
(c) -> Copyright
account_cutoff_prepaid/README.rst
Outdated
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/89/10.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.
/11.0
'license': 'AGPL-3', | ||
'summary': 'Prepaid Expense, Prepaid Revenue', | ||
'author': 'Akretion,Odoo Community Association (OCA)', | ||
'website': 'http://www.akretion.com', |
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.
@api.model | ||
def _get_default_source_journals(self): | ||
res = [] | ||
cutoff_type = self._context.get('type') |
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.
self.env.context
source_journal_ids = fields.Many2many( | ||
'account.journal', column1='cutoff_id', column2='journal_id', | ||
string='Source Journals', readonly=True, | ||
default=_get_default_source_journals, |
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.
proxy this w/ a lambda
'The start date is after the end date!')) | ||
|
||
@api.onchange('forecast') | ||
def forecast_onchange(self): |
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.
rename to onchange_forecast
'amount': aml.credit - aml.debit, | ||
'currency_id': self.company_currency_id.id, | ||
'cutoff_amount': cutoff_amount, | ||
} |
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.
parenthesis one tab back (same for all those occurrences where the closing one does not match visually the opening one)
return True | ||
|
||
@api.model | ||
def _inherit_default_cutoff_account_id(self): |
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 you proxy the method in the field (as stated in the base PR) you have to remove _inherit_
here
@api.model | ||
def _inherit_default_cutoff_account_id(self): | ||
account_id = super()._inherit_default_cutoff_account_id() | ||
cutoff_type = self._context.get('type') |
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.
self.env.context
}) | ||
return cutoff | ||
|
||
def test_0(self): |
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.
give these methods meaningful name :)
@api.model | ||
def _get_default_source_journals(self): | ||
res = [] | ||
cutoff_type = self._context.get('type') |
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.
should also be noted to not forget change type
here if it will be renamed in base module
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!
Code review only.
@OleksandrPaziuk can you update this? |
Use assert Remove .keys() No space before colon PEP8/Flake8 : getting closer to compliancy
….get('type', '-')
…de domains) On account.account, type must be <> 'view' and <> 'closed'
…a single warning left ! Add translation template files.
Migration by @alexis-via @sbidoul added: * extensibility hooks * a multi-company record rule * some tests @gurneyalex moved the module desciption to README.rst as part of the merge
…ct.product This should make runbot green.
Extract a new module account_invoice_start_end_dates from account_cutoff_prepaid
Use triple double quotes for docstring Replace <openerp> by <odoo> in XML Remove <data> tags in XML Remove POT files
👍 |
@simahawk It is all goo for me. |
@api.model | ||
def _default_cutoff_account_id(self): | ||
account_id = super()._default_cutoff_account_id() | ||
cutoff_type = self.env.context.get('type') |
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.
@mpanarin hasn't this been renamed to cutoff_type
in the base module? Pls, adjust any occurrence accordingly (pay attention to not mess up w/ the account type
w/ a find/replace 😉 )
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.
@mpanarin see my comment about the ctx var. Also, as your testing it, would you mind replacing the screenshots? This one is not a blocker: you can submit another PR later... but do not forget about 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.
LGTM )
@fclementic2c all good 😉 |
Configure partner names to firstname first
Depends on: