Skip to content
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

Merged
merged 28 commits into from Jan 25, 2018
Merged

11.0 mig account_cutoff_prepaid #60

merged 28 commits into from Jan 25, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 3, 2018

Depends on:

Copy link
Contributor

@simahawk simahawk left a 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>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(c) -> Copyright


.. 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
Copy link
Contributor

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',
Copy link
Contributor

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')
Copy link
Contributor

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,
Copy link
Contributor

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):
Copy link
Contributor

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,
}
Copy link
Contributor

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):
Copy link
Contributor

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')
Copy link
Contributor

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):
Copy link
Contributor

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')

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

@ghost ghost changed the title 11.0 mig account cutoff prepaid 11.0 mig account_cutoff_prepaid Jan 11, 2018
Copy link

@leemannd leemannd left a 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.

@simahawk
Copy link
Contributor

@OleksandrPaziuk can you update this?

Alexis de Lattre and others added 21 commits January 24, 2018 11:28
Use assert
Remove .keys()
No space before colon
PEP8/Flake8 : getting closer to compliancy
…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
alexis-via and others added 6 commits January 24, 2018 11:28
@fclementic2c
Copy link
Member

I have a error when I click on any cut-off menus : see printscreen
screenshot-3315644-60-f88c0a runbot1 odoo-community org-2018-01-24-15-38-17-562

@fclementic2c
Copy link
Member

fclementic2c commented Jan 24, 2018

if empty -> take all journals by default

screenshot-3315697-60-89cda9 runbot1 odoo-community org-2018-01-24-16-47-32-525 1

@fclementic2c
Copy link
Member

👍
ready to be merged for me

@fclementic2c
Copy link
Member

@simahawk It is all goo for me.
I need another approval please

@api.model
def _default_cutoff_account_id(self):
account_id = super()._default_cutoff_account_id()
cutoff_type = self.env.context.get('type')
Copy link
Contributor

@simahawk simahawk Jan 25, 2018

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 😉 )

Copy link
Contributor

@simahawk simahawk left a 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 ;)

Copy link

@mpanarin mpanarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM )

@simahawk
Copy link
Contributor

@fclementic2c all good 😉

@fclementic2c fclementic2c merged commit 75e0fb9 into OCA:11.0 Jan 25, 2018
Mraimou pushed a commit to camptocamp/account-closing that referenced this pull request Apr 20, 2021
Configure partner names to firstname first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet