-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
[MIG] account_cutoff_base: Migration to 16.0 #213
Conversation
ca261b2
to
284e82c
Compare
284e82c
to
331fbe9
Compare
331fbe9
to
ff4560b
Compare
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% (134 of 134 strings) Translation: account-closing-15.0/account-closing-15.0-account_cutoff_base Translate-URL: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_cutoff_base/es_AR/
ff4560b
to
d302a89
Compare
d302a89
to
1697b56
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.
Non-blocking comments
company_currency_id = fields.Many2one( | ||
related="parent_id.company_currency_id", | ||
string="Company Currency", | ||
readonly=True, |
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.
readonly is redundant here, in case you want to remove it
) | ||
partner_id = fields.Many2one("res.partner", string="Partner", readonly=True) | ||
quantity = fields.Float(digits="Product Unit of Measure", readonly=True) | ||
price_unit = fields.Float( |
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 could be a Monetary field
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.
No. price_unit are not monetary fields for decimal precision reasons, cf https://github.com/odoo/odoo/blob/16.0/addons/sale/models/sale_order_line.py#L139
A price_unit can have a decimal precision higher than the currency precision.
help="Price per unit (discount included) without taxes in the default " | ||
"unit of measure of the product in the currency of the 'Currency' field.", | ||
) | ||
price_origin = fields.Char(readonly=True) |
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 fail to understand the purpose of this field, and why it is a Char
but it's name suggests a price (thus it should be Float
or Monetary
)
Is this field even used? If so, what for? Should this be commented in the help
attribute?
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's a small note field that indicate where the price has been taken from. So it contains an invoice number, a PO number or an SO number.
price_origin = fields.Char(readonly=True) | ||
origin_move_line_id = fields.Many2one( | ||
"account.move.line", string="Origin Journal Item", readonly=True | ||
) # Old name: move_line_id |
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.
Maybe remove the # Old name:
comments.
Seem like they're outdated by now
origin_move_date = fields.Date( | ||
related="origin_move_line_id.move_id.date", string="Origin Journal Entry Date" | ||
) # old name: move_date | ||
account_id = fields.Many2one( |
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.
IMO, this model should have _check_company_auto = True
, and a check_company on this account_id
field.
(Maybe also other fields, if relevant)
ondelete="cascade", | ||
required=True, | ||
) | ||
tax_id = fields.Many2one("account.tax", string="Tax", required=True) |
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.
check_company
maybe?
1697b56
to
54ecf1c
Compare
@ivantodorovich , thank you for you comments, the PR has been updated About the field |
I'm preparing a PR on this PR, to take into account my comments and make a few improvements |
Revert price_unit to fields.Float() and price_origin to fields.Char() Forward port post_cutoff_move on res.company from v14 Add ACLs for account readonly group Remove duplicate-xml-fields, cf https://github.com/OCA/maintainer-tools/issues/558 Add name_get() on account.cutoff Rename field move_label to move_ref Update code to be able to add additional states (e.g. 'forecast' state introduced account_cutoff_start_end_dates) Cleanup and improve views
Here it is: dzungtran89#1 |
[16.0] account_cutoff_base: improve your OCA PR
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at b2e2a7a. Thanks a lot for contributing to OCA. ❤️ |
/ocabot migration account_cutoff_base |
@dzungtran89 next time, please, remove merge commits if you integrate other PRs. Thanks. |
hi @simahawk, well noted with thanks |
Needs
pre-commit
fixesNote:
groups
from thecompany_id
field is to avoid violating the check by the native, see here