[19.0][MIG] account_cutoff_base#357
Conversation
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.
The signature of existing methods is preserved.
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
Currently translated at 100,0% (73 of 73 strings) Translation: account-closing-11.0/account-closing-11.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-11-0/account-closing-11-0-account_cutoff_base/de/
Currently translated at 100.0% (133 of 133 strings) Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/it/
Currently translated at 100.0% (133 of 133 strings) Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/sv/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/
Currently translated at 100.0% (132 of 132 strings) Translation: account-closing-17.0/account-closing-17.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base/it/
Add record rules for cutoff lines and cutoff tax lines
On account.cutoff, the domain for the cutoff journal has type='general', like on the default value the accounting config page
Fix license in manifest which was set to LGPL by mistake in the migration commit from v16 to v17
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/
Currently translated at 100.0% (132 of 132 strings) Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/it/
Currently translated at 100.0% (132 of 132 strings) Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/fr/
Currently translated at 100.0% (132 of 132 strings) Translation: account-closing-18.0/account-closing-18.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-18-0/account-closing-18-0-account_cutoff_base/es_AR/
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
petrus-v
left a comment
There was a problem hiding this comment.
I'm approving with some improvement suggestions. Also I would love to see more tests in this module, as an independent module it should cover its code.
| _check_company_auto = True | ||
| _description = "Account Cut-off Line" | ||
|
|
||
| parent_id = fields.Many2one("account.cutoff", string="Cut-off", ondelete="cascade") |
There was a problem hiding this comment.
I would have called it account_cutoff_id, parent/child are mainly used when model is pointing to itself
| def _get_mapping_dict(self): | ||
| """return a dict with: | ||
| key = ID of account, | ||
| value = ID of cutoff_account""" | ||
| self.ensure_one() | ||
| mappings = self.env["account.cutoff.mapping"].search( | ||
| Domain( | ||
| [ | ||
| ("company_id", "=", self.company_id.id), | ||
| ("cutoff_type", "in", ("all", self.cutoff_type)), | ||
| ] | ||
| ) | ||
| ) |
There was a problem hiding this comment.
I can see this method is used in account_cutoff_start_and_end dates module but I would rather prepare the mapping record with concerned record only so this method could use an optionnal source accounts.
| def _get_mapping_dict(self): | |
| """return a dict with: | |
| key = ID of account, | |
| value = ID of cutoff_account""" | |
| self.ensure_one() | |
| mappings = self.env["account.cutoff.mapping"].search( | |
| Domain( | |
| [ | |
| ("company_id", "=", self.company_id.id), | |
| ("cutoff_type", "in", ("all", self.cutoff_type)), | |
| ] | |
| ) | |
| ) | |
| def _get_mapping_dict(self, source_accounts=None): | |
| """return a dict with: | |
| key = ID of account, | |
| value = ID of cutoff_account""" | |
| self.ensure_one() | |
| domain = Domain( | |
| [ | |
| ("company_id", "=", self.company_id.id), | |
| ("cutoff_type", "in", ("all", self.cutoff_type)), | |
| ] | |
| ) | |
| if source_accounts: | |
| domain &= Domain("account_id", "in", source_accounts.ids) | |
| mappings = self.env["account.cutoff.mapping"].search( | |
| ) |
AnizR
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
Code LGTM, just some nit picking.
| options="{'no_create': True}" | ||
| readonly="state == 'done'" | ||
| /> | ||
| <field name="company_currency_id" invisible="1" /> |
There was a problem hiding this comment.
Can be safely removed since odoo/odoo#137031
| <field name="company_currency_id" invisible="1" /> |
| <field name="cutoff_date" decoration-bf="1" /> | ||
| <field name="move_ref" optional="hide" /> | ||
| <field name="total_cutoff_amount" /> | ||
| <field name="company_currency_id" column_invisible="1" /> |
There was a problem hiding this comment.
Can be safely removed
| <field name="company_currency_id" column_invisible="1" /> |
|
This PR has the |
|
@alexis-via I've propose a PR on top of yours to take care of main reviews here. the last but not least is the field renaming (parent_id to cutoff_id and cutoff_line_id), I've a commit that do it, it is working but will impact other modules, so do you think we can do it in this version or do you prefer to do it in the next version ? |
No description provided.