[19.0][MIG] project_task_code: Migration to 19.0#1667
[19.0][MIG] project_task_code: Migration to 19.0#1667Kiplangatdan wants to merge 61 commits intoOCA:19.0from
Conversation
a1cf349 to
dab13dd
Compare
luisDIXMIT
left a comment
There was a problem hiding this comment.
Code review and tested on runboat, LGTM! Only one minnor suggestion.
166e862 to
76549cb
Compare
|
76549cb @Kiplangatdan The name of this commit should be: |
76549cb to
baeba83
Compare
alexey-pelykh
left a comment
There was a problem hiding this comment.
Clean migration with proper hooks. LGTM
|
This PR has the |
2 similar comments
|
This PR has the |
|
This PR has the |
alexey-pelykh
left a comment
There was a problem hiding this comment.
Good migration overall -- the module correctly adopts Odoo 19.0 patterns (models.Constraint, @api.model_create_multi, _rec_names_search, BaseCommon in tests). A couple of minor observations below.
Observations:
-
Unused
PROJECT_TASK_WRITABLE_FIELDS(models/project_task.py): The setPROJECT_TASK_WRITABLE_FIELDS = {"code"}is defined at module level but never referenced anywhere in this module. If this is intended for portal write access (as seen in some Odoo core patterns), the integration withproject'sWRITABLE_FIELDSwould need to be wired up. Otherwise it is dead code. -
.potfile version (i18n/project_task_code.pot): TheProject-Id-Versionheader saysOdoo Server 18.0-- should be19.0to match the target branch. This is cosmetic and typically auto-regenerated byoca-gen-addon-readme, so not blocking. -
Redundant search
filter_domain(views/project_view.xml): The search view overrides thenamefield'sfilter_domainto includecodein the search. However,_rec_names_search = ["name", "code"]on the model already handlesname_searchlookups covering both fields. The XMLfilter_domainis for the search bar in list/kanban views specifically, so both are actually needed for complete coverage -- this is correct as-is.
Already approved in a previous review. These observations are non-blocking.
Review posted via CorporateHub OCA review campaign
OCA Transbot updated translations from Transifex [MIG] project_task_code: Migrate to 10.0 Edit init and XML Add env Change task_ids to tasks Change to @api.multi before def copy
Relational fields and the task notification email inform the task code
The overload of project.task::create in the project_task_code would mutate the dictionaries passed in the vals_list argument. This is a bad practice which can have unintended side effects in caller code. We fix this by creating a new dictionary containing the additional field value and passing this dictionary in the call to super().create()
…olates not-null constraint
Currently, the sequence that generates task codes is only available for the main company [1], which could cause issues at the moment of the installation process with another modules in multi-companies cases, for example project_timesheet_holiday [2] because in the other companies, this line [3] will return False or "/" and will trigger the UNIQUE constraint. With this change, the sequence can be used by any company [4] using the False value in the field company_id. References: [1] https://github.com/odoo/odoo/blob/7b6c25e/odoo/addons/base/models/ir_sequence.py#L148 [2] https://github.com/odoo/odoo/blob/7b6c25e/addons/project_timesheet_holidays/models/res_company.py#L14 [3] https://github.com/OCA/project/blob/9d08f2d/project_task_code/models/project_task.py#L29 [4] https://github.com/odoo/odoo/blob/7b6c25e/odoo/addons/base/models/ir_sequence.py#L282
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/
Currently translated at 100.0% (4 of 4 strings) Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/it/
Currently translated at 100.0% (4 of 4 strings) Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/es/
Currently translated at 100.0% (4 of 4 strings) Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/es_AR/
Currently translated at 100.0% (4 of 4 strings) Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/it/
Currently translated at 100.0% (4 of 4 strings) Translation: project-16.0/project-16.0-project_task_code Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code/pt_BR/
Search task by its code in x2m fields.
tasks created from Portal
baeba83 to
e3e51af
Compare
e3e51af to
08fd274
Compare
AaronHForgeFlow
left a comment
There was a problem hiding this comment.
Functional ok! just a minor comment.
| <field name="inherit_id" ref="project.view_task_search_form" /> | ||
| <field name="arch" type="xml"> | ||
| <field name="name" position="attributes"> | ||
| <attribute name="filter_domain">['|', ('name', 'ilike', self), |
There was a problem hiding this comment.
maybe this is not neede if we add the _rec_names_search parameter on the model.
No description provided.