-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
[FIX] Upgrade mgmtsystem_claim to v9.0 #141
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
aedc026
[FIX] Upgrade to odoo v9.0
Jeroen7V 87d35c8
Merge branch '9.0' of https://github.com/OCA/management-system into HEAD
Jeroen7V 7dbaf7d
[FIX] Issues found when asking for pull
Jeroen7V d68bbd2
[ADD] pivot view, remove board
Jeroen7V 350fa99
[FIX] typo 'group=' to 'groups='
Jeroen7V f8bcafe
[FIX] menu.xml last
Jeroen7V 8e9e32d
[FIX] Order of xml views
Jeroen7V d2f00f6
[FIX] ir_sequence.next deprecated, add acces rule report
Jeroen7V 81de60c
[FIX] lint errors
Jeroen7V 3fad522
[FIX] Lint errors
Jeroen7V 24a860c
Merge branch '9.0' of https://github.com/OCA/management-system into HEAD
Jeroen7V 9671dfa
Merge branch '9.0' of https://github.com/OCA/management-system into HEAD
Jeroen7V 8f714ed
[FIX] Attribute name should be groups
Jeroen7V 2b2e89f
[FIX] revert changes
Jeroen7V 7c5c733
Merge branch '9.0' of https://github.com/OCA/management-system into HEAD
Jeroen7V a721384
[ADD] add parameter case_default=true to claim stages
Jeroen7V File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
<openerp> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="stage_draft" model="mgmtsystem.claim.stage"> | ||
<field name="name">draft</field> | ||
<field name="sequence">0</field> | ||
<field name="case_default" eval="True"/> | ||
</record> | ||
|
||
<record id="stage_pending" model="mgmtsystem.claim.stage"> | ||
<field name="name">pending</field> | ||
<field name="sequence">250</field> | ||
<field name="case_default" eval="True"/> | ||
</record> | ||
|
||
<record id="stage_open" model="mgmtsystem.claim.stage"> | ||
<field name="name">open</field> | ||
<field name="sequence">500</field> | ||
<field name="case_default" eval="True"/> | ||
</record> | ||
|
||
<record id="stage_close" model="mgmtsystem.claim.stage"> | ||
<field name="name">close</field> | ||
<field name="sequence">750</field> | ||
<field name="case_default" eval="True"/> | ||
</record> | ||
|
||
<record id="stage_cancel" model="mgmtsystem.claim.stage"> | ||
<field name="name">cancel</field> | ||
<field name="sequence">750</field> | ||
<field name="sequence">1000</field> | ||
<field name="case_default" eval="True"/> | ||
</record> | ||
|
||
</data> | ||
</openerp> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from . import mgmtsystem_claim_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from openerp import fields, models | ||
from openerp import tools | ||
|
||
|
||
class MgmtsystemtClaimReport(models.Model): | ||
"""Management System Claim Report.""" | ||
|
||
_name = "mgmtsystem.claim.report" | ||
_auto = False | ||
_description = "Management System Claim Report" | ||
_rec_name = 'id' | ||
|
||
# Compute data | ||
number_of_claims = fields.Integer('# of claims', readonly=True) | ||
age = fields.Integer('Age', readonly=True) | ||
number_of_days_to_close = fields.Integer( | ||
'# of days to close', readonly=True) | ||
number_of_exceedings_days = fields.Integer( | ||
'# of exceedings days', readonly=True) | ||
|
||
# Grouping view | ||
create_date = fields.Datetime('Create Date', readonly=True, select=True) | ||
write_date = fields.Datetime('Update Date', readonly=True, select=True) | ||
date_closed = fields.Datetime('Close Date', readonly=True, select=True) | ||
date_deadline = fields.Date('Deadline', readonly=True, select=True) | ||
user_id = fields.Many2one('res.users', 'User', readonly=True) | ||
stage_id = fields.Many2one( | ||
'mgmtsystem.claim.stage', 'Stage', readonly=True) | ||
|
||
def init(self, cr): | ||
"""Display a pivot view of claim.""" | ||
tools.drop_view_if_exists(cr, 'mgmtsystem_claim_report') | ||
cr.execute(""" | ||
CREATE OR REPLACE VIEW mgmtsystem_claim_report AS ( | ||
select | ||
m.id, | ||
m.date_closed as date_closed, | ||
m.date_deadline as date_deadline, | ||
m.user_id, | ||
m.stage_id, | ||
m.create_date as create_date, | ||
count(*) AS number_of_claims | ||
from | ||
mgmtsystem_claim m | ||
group by m.user_id, m.stage_id, m.date, \ | ||
m.create_date,m.date_deadline, \ | ||
m.date_closed, m.id | ||
) | ||
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<odoo> | ||
<data> | ||
|
||
<!-- Management System Claim Report Pivot View --> | ||
|
||
<record id="view_report_mgmtsystem_claim_pivot" model="ir.ui.view"> | ||
<field name="name">mgmtsystem.claim.report.pivot</field> | ||
<field name="model">mgmtsystem.claim.report</field> | ||
<field name="arch" type="xml"> | ||
<pivot string="Actions" disable_linking="True"> | ||
<field name="stage_id" type="row"/> | ||
<field name="user_id" type="col"/> | ||
<field name="number_of_claims" type="measure"/> | ||
</pivot> | ||
</field> | ||
</record> | ||
|
||
<!-- Management System Claim Report Graph View --> | ||
|
||
<record id="view_report_mgmtsystem_claim_graph" model="ir.ui.view"> | ||
<field name="name">mgmtsystem.claim.report.graph</field> | ||
<field name="model">mgmtsystem.claim.report</field> | ||
<field name="arch" type="xml"> | ||
<graph string="Actions"> | ||
<field name="stage_id"/> | ||
<field name="user_id"/> | ||
<field name="number_of_claims" type="measure"/> | ||
</graph> | ||
</field> | ||
</record> | ||
|
||
<!-- Management system Claim Report Action --> | ||
|
||
<record id="action_report_mgmtsystem_claim" model="ir.actions.act_window"> | ||
<field name="name">Management System Analysis</field> | ||
<field name="res_model">mgmtsystem.claim.report</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">pivot,graph</field> | ||
<field name="context">{"search_default_year":1,"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}</field> | ||
<field name="view_id"></field> <!-- force empty --> | ||
<field name="help">Have a general overview of all claims processed in the system by sorting them with specific criteria.</field> | ||
</record> | ||
|
||
</data> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | ||
"access_mgmtsystem_claim","mgmtsystem.claim.user","model_mgmtsystem_claim","base.group_user",1,1,1,0 | ||
"access_mgmtsystem_claim_stage","access_mgmtsystem_claim_stage","model_mgmtsystem_claim_stage","base.group_user",1,0,0,0 | ||
"access_mgmtsystem_claim_report","access_mgmtsystem_claim_report","model_mgmtsystem_claim_report","base.group_user",1,0,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# -*- encoding: utf-8 -*- | ||
# -*- coding: utf-8 -*- | ||
|
||
from openerp.tests import common | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 group by operation is redundant, since it groups by
id
.IMO skip completely the report model, and instead just add a Pivot view to the
mgmtsystem.claim
model.