Skip to content

[13.0][MIG] mgmtsystem_nonconformity: Migration to 13.0 #275

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

Merged
merged 52 commits into from
Nov 30, 2019

Conversation

ernestotejeda
Copy link
Member

Cc @Tecnativa TT20483

Maxime Chambreuil and others added 30 commits November 26, 2019 12:39
…ons.

[IMP] [#9439] Added the system reference field to the model and the views.
[IMP] efficiency -> effectiveness
[FIX] group_mgmtsystem_manager XML ID
[IMP] mgmtsystem_kpi
[FIX] Group references. Reported by michaelgiesbrecht on the forum.
[ADD] Icons
[IMP] Views
[ADD] NC : Workflow, actions_ids
[ADD] Action : Review fields
[REM] NC : Effectiveness fields
[IMP] Use workflow and improve filters.
[FIX] button_cancel invisible and system_id readonly on closed state.
[FIX] Can't group by procedure_ids
* ADD workflow reset option. ADD workflow transition from Open to Pending. CHG config tables are translatable. ADD pt translation.
* CHG process sequence logic. ADD approval records for each stage.
* CHG: finetunning user interface
* [ADD] Actions link back to NCs. [CHG] Actions UI improvements. [DEL] Action review not necessary. [ADD] NC on_change department fills automatically responsibles.
* ADD: communication & history tab for NCs
* ADD: keep history record for state changes and approvals

pt translations
…al module + qualification fields moved from feedback to NC; actions can be linked to projects
CHG: NC analysis is required at state 'p'

CHG: added parent to group NC Causes; removed NC Category

ADD: state 'analysis', between 'draft' and 'pending'

CHG: NC flow logic organized according to the typical sequence

CHG: small fixes and finetuning

CHG: marking Apps, security review, translation pt, finetuning
* licenses and dependencies
* Update hooks with addons modules from v7
* Permissions on files
* Add origins and causes data
* CHG Renamed 'feedback' to 'claim', see explanation  in __openerp__.py
* CHG pt_pt translation
* FIX Fixing fields read-only flags based on state
* CHG Improving action <-> NC relationship (wip)
* [FIX] fixes from review comments
* [FIX] missing context; instanciation of models
* [CHG] AGPL license; set verion to 1.0
* [CHG] Selections use words instead of letters; fixed AGPL-3 reference
* [FIX] .py files licenses to AGPL
* NameError: global name 'context' is not defined when resetting a NC
* Skeleton for migration script
* openupgrade analysis
[ADD] Added migration scripts for 0.1 --> 1.0 in the modules that needed it.

mgmtsystem_nonconformity:

* o --> open c --> done state change.
* Migrating action relations to a many2many table.
* Concatening action comments in a single field

mgmtsystem_audit and mgmtsystem_review:

* o --> open c --> done state change.

[FIX] I had accidentally broken the nonconformity/action migration shortly before commit.

[FIX] Fixed "Unknown field state for domain" errors.

In 7.0, it's necessary, in a view, to have the field present in a view in order to use it
in a domain. I added an invisible "state" field in relevant views to fix the errors.

[CHG] Adjusted mgmgsystem_nonconformity to OpenERP 7.0.

Like with mgmtsystem_action, the problem comes from changes made in OpenERP's messaging system.

[FIX] Broken reference to wiki's group_id.

In OpenERP 7, document_page had a parent_id instead of wiki's group_id. I've fixed the broken references that we had left in nonconformity and audit.

[FIX] Fixed wrongful merge.

The merge of nc-extend-7.0 was incorrect. It wrongly used the 6.1 version of mgmtsystem_audit.xml and mgmtsystem_nonconformity/mgmtsystem_nonconformity.xml. Fixed this.

[CHG] Updated statusbar/buttons's layout to conform to OpenERP 7.0 style.

Instead of a group at the bottom of the form, it's now a <header> tag at the top.

Changed Actions, Audit, Nonconformity and Review.
"osv" was mistakenly removed from imports in nc-extend.
…with orm.except_orm()+ Fixed calls to action.case_open() which were made with explicit (cr, uid, id) args.

Now, these methods' arguments are implicitly set.
… replaced message history with chatter widget
* [FIX] Remaining group_id
* [FIX] Update domain
* [UPD] POT files
* [IMP] Add company_id and its default value
* [IMP] Add company_id in views
* [ADD] mgmtsystem_*_security.xml files
* Added autosubscription for Responsible user, Manager and Top manager to follow list of OpenChatter
* Autoadding the nonconformity author.
* Exception when closing NC that has non closed actions.
* Added state 'cancelled' and check for immediate actions.
* Improvement to NC chatter state change messages.
* Buttons that change state backwards (towards draft) are no longer highlighted.
* Prefix overwriten for Nonconformity
* Fix to integrity check error
* revert unessessary_inherit to crm.claim
* [FIX] Fix PEP8 errors after running 'flake8 . --ignore E501,F401'
* [7.0.1.0 Migration scirpts] Added mgmtsystem_action. Made mgmtsystem_nonconformity system more robust.
* [FIX] Migration scripts no longer fully dependent on openupgrade
* [FIX] Bug #1267840 add values parametter to message_auto_subscribe
* Removed redundant import from openupgrade
Updated module as installable and removed depdencie on base_status

See

the base_status module is apparently gone so we have to work without it.
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-remove-base_status-tde/+merge/179887

Small fix to use stage_id.name instead of state

State doesn't exist anymore

Use stage_id for actions

Add support for settled, rejected instead of done/canceled... quite ugly

Separated python in each model file

Added missing methodcase_close_send_note for workflows

Updated model severity to V8

Port cause model to v8

Fix flake8 error

Fix small error in `cause` and upgraded `origin` to v8

Splitted xml views into 5 different xml files

Moved icon.png to static/description

Added tests and updated cause to v8

Added test origin and changed name of test class for cause

Removed severity redefined here

Added tests for create nonconformity

Ported fields to v8

Fix indent block

Removed ID and removed named lambdas

Simplify the name_get method

Get exceptions without importing orm

Removed size

Simplified name_get and removed id

Replace try except by self.assertRaise

Added group in forms

Reformat xml files removed tabs/space mix and 2 space indent

Fix tests

Added left and right to cause and origin

Add ondelete to parent_id

Fix tests

Improved name_get method and full coverage or origin/cause

Added workflow test

Added missing copyrights

Fix flake errors

Fix more flake errors

Some actions can only be done once actions, analysis

Fix even more flakes errors

Test reset button

Added missing fields (used in demo data)

Test state nonconformity name

Remove states as we are using stages on actions...

It would make more sense to add a property to stages that mark some
stages as ending stages instead of checking by names.

Use stage is ending and is starting instead of by name

Test analysis instead of evaluation

Fix flake8 errors

Added base security

Security rule in wrong project
* Move datas to their own folders
* Cleanup Nonconformity
* Use track and mail message subtypes instead of overriding functions
* Remove unused functions
* Cleanup and full use of v8 and track features
* Use a python context which does rollback
* Fix pep8
* Full test coverage of module
* Improving test coverage
* Fixing flake 8 error
* Fixing test error
* Remove unnecessary code
* adding drag and drop to kanban view
* Fixing flake 8 error
* Fixing tests errors
* add mgmtsystem_nonconformity_state access rule
* removing unused code
* Improving form and test
* Remove forced workflow logic
* Add kanban state
* Fix report state field
* Nonconformity view must load state data
* Adjust tests and make them pass
* Add kanban state (can be used for approvals)
* Fix duplicate stage/state tracking
* Fix report menu
* Add validation on close, requiring evaluation comment
* Replace age by days since last update
* Fix reports
* Reset Kanban State when changing Stages
* Prefer using the standard user_id field
* Properly implement the NC closing date
* Require action plan review for In Progress; Open Actions when In Progress
* Rename Pending Approval to Action Plan
oca-transbot and others added 15 commits November 26, 2019 12:39
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Currently translated at 95.0% (114 of 120 strings)

Translation: management-system-11.0/management-system-11.0-mgmtsystem_nonconformity
Translate-URL: https://translation.odoo-community.org/projects/management-system-11-0/management-system-11-0-mgmtsystem_nonconformity/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity
Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity/
[ADD] mgmtsystem_nonconformity: Add activities to nonconformity

Add the activities to the model "nonconformity"
Currently translated at 100.0% (120 of 120 strings)

Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity
Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity/pt_BR/
Without decorator, you receive a cursor, not an environment
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity
Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity/
Currently translated at 100.0% (147 of 147 strings)

Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity
Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity/pt_BR/
@oca-clabot
Copy link

Hey @ernestotejeda, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

def _elapsed_days(self, dt1_text, dt2_text):
res = 0
if dt1_text and dt2_text:
dt1 = fields.Datetime.from_string(dt1_text)
Copy link
Member

Choose a reason for hiding this comment

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

Be carefully... since 12.0 Odoo uses native python datetime (not strings)

def name_get(self):
res = []
for obj in self:
name = obj.name
Copy link
Member

Choose a reason for hiding this comment

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

The same as in the other case

@@ -0,0 +1,23 @@
##############################################################################
Copy link
Member

Choose a reason for hiding this comment

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

Use a short license comment


class TestModelNonConformity(common.TransactionCase):
def setUp(self):
super(TestModelNonConformity, self).setUp()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
super(TestModelNonConformity, self).setUp()
super().setUp()

<filter name="groupby_system" string="System" icon="gtk-execute" context="{'group_by':'system_id'}"/>
<filter name="groupby_partner" string="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
<filter name="groupby_procedure" string="Procedure" icon="terp-stock_symbol-selection" context="{'group_by':'procedure_ids'}"/>
<!--
Copy link
Member

Choose a reason for hiding this comment

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

If not used 🔥

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Attend @Tardo comments. Otherwise LGTM

@ernestotejeda ernestotejeda force-pushed the 13.0-mig-mgmtsystem_nonconformity branch from 05ba650 to 7d1096d Compare November 28, 2019 15:05
@ernestotejeda
Copy link
Member Author

Changes done

@pedrobaeza
Copy link
Member

As comments have been attended:

/ocabot merge

@OCA-git-bot OCA-git-bot mentioned this pull request Nov 30, 2019
21 tasks
@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 13.0-ocabot-merge-pr-275-by-pedrobaeza-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 30, 2019
Signed-off-by pedrobaeza
@OCA-git-bot OCA-git-bot merged commit 7d1096d into OCA:13.0 Nov 30, 2019
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 5d36bf5. Thanks a lot for contributing to OCA. ❤️

@max3903 max3903 added this to the 13.0 milestone Mar 11, 2020
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.