Skip to content

Commit

Permalink
[MIG] crm_claim: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatObrador committed Aug 8, 2024
1 parent 3cb4cd6 commit b638ae0
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 25 deletions.
4 changes: 4 additions & 0 deletions crm_claim/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ Contributors

- Fernando La Chica <[email protected]>

- `APSL-Nagarro <https://apsl.tech>`__:

- Bernat Obrador <[email protected]>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion crm_claim/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Claims Management",
"version": "16.0.1.2.0",
"version": "17.0.1.0.0",
"category": "Customer Relationship Management",
"author": "Odoo S.A., Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/crm",
Expand Down
6 changes: 3 additions & 3 deletions crm_claim/models/crm_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def _selection_model(self):
active = fields.Boolean(default=True)
description = fields.Text()
resolution = fields.Text()
create_date = fields.Datetime(string="Creation Date", readonly=True)
write_date = fields.Datetime(string="Update Date", readonly=True)
create_date = fields.Datetime(string="Creation Date")
write_date = fields.Datetime(string="Update Date")
date_deadline = fields.Date(string="Deadline")
date_closed = fields.Datetime(string="Closed", readonly=True)
date_closed = fields.Datetime(string="Closed")
date = fields.Datetime(string="Claim Date", index=True, default=fields.Datetime.now)
model_ref_id = fields.Reference(
selection="_selection_model", string="Model Reference"
Expand Down
2 changes: 2 additions & 0 deletions crm_claim/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
- Ruchir Shukla \<<[email protected]>\>
- [Guadaltech](https://www.guadaltech.es):
- Fernando La Chica \<<[email protected]>\>
- [APSL-Nagarro](<https://apsl.tech>):
- Bernat Obrador \<<[email protected]>\>
36 changes: 21 additions & 15 deletions crm_claim/report/crm_claim_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,35 @@ class CrmClaimReport(models.Model):
_auto = False
_description = "CRM Claim Report"

user_id = fields.Many2one(comodel_name="res.users", string="User", readonly=True)
team_id = fields.Many2one(comodel_name="crm.team", string="Team", readonly=True)
nbr_claims = fields.Integer(string="# of Claims", readonly=True)
user_id = fields.Many2one(comodel_name="res.users", string="User")
team_id = fields.Many2one(comodel_name="crm.team", string="Team")
nbr_claims = fields.Integer(
string="# of Claims",
)
company_id = fields.Many2one(
comodel_name="res.company", string="Company", readonly=True
comodel_name="res.company",
string="Company",
)
create_date = fields.Datetime(readonly=True, index=True)
claim_date = fields.Datetime(readonly=True)
create_date = fields.Datetime(index=True)
claim_date = fields.Datetime()
delay_close = fields.Float(
string="Delay to close",
digits=(16, 2),
readonly=True,
group_operator="avg",
help="Number of Days to close the case",
)
stage_id = fields.Many2one(
comodel_name="crm.claim.stage",
string="Stage",
readonly=True,
domain="[('team_ids','=',team_id)]",
)
categ_id = fields.Many2one(
comodel_name="crm.claim.category", string="Category", readonly=True
comodel_name="crm.claim.category",
string="Category",
)
partner_id = fields.Many2one(
comodel_name="res.partner", string="Partner", readonly=True
comodel_name="res.partner",
string="Partner",
)
priority = fields.Selection(
selection=[("0", "Low"), ("1", "Normal"), ("2", "High")]
Expand All @@ -52,16 +55,19 @@ class CrmClaimReport(models.Model):
],
string="Action Type",
)
date_closed = fields.Datetime(string="Close Date", readonly=True, index=True)
date_deadline = fields.Date(string="Deadline", readonly=True, index=True)
date_closed = fields.Datetime(string="Close Date", index=True)
date_deadline = fields.Date(string="Deadline", index=True)
delay_expected = fields.Float(
string="Overpassed Deadline",
digits=(16, 2),
readonly=True,
group_operator="avg",
)
email = fields.Integer(string="# Emails", readonly=True)
subject = fields.Char(string="Claim Subject", readonly=True)
email = fields.Integer(
string="# Emails",
)
subject = fields.Char(
string="Claim Subject",
)

def _select(self):
select_str = """
Expand Down
35 changes: 35 additions & 0 deletions crm_claim/report/crm_claim_report_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,41 @@
</pivot>
</field>
</record>

<record id="test_view_form" model="ir.ui.view">
<field name="name">test.view.form</field>
<field name="model">crm.claim.report</field>
<field name="arch" type="xml">
<form string="">
<sheet>
<group>
<group>
<field name="user_id" readonly="1" />
<field name="nbr_claims" readonly="1" />
<field name="create_date" readonly="1" />
<field name="delay_close" readonly="1" />
<field name="categ_id" readonly="1" />
<field name="priority" />
<field name="date_closed" readonly="1" />
<field name="delay_expected" readonly="1" />
<field name="subject" readonly="1" />
</group>
<group>
<field name="team_id" readonly="1" />
<field name="company_id" readonly="1" />
<field name="claim_date" readonly="1" />
<field name="stage_id" readonly="1" />
<field name="partner_id" readonly="1" />
<field name="type_action" />
<field name="date_deadline" readonly="1" />
<field name="email" readonly="1" />
</group>
</group>
</sheet>
</form>
</field>
</record>

<record id="view_report_crm_claim_graph" model="ir.ui.view">
<field name="name">crm.claim.report.graph</field>
<field name="model">crm.claim.report</field>
Expand Down
4 changes: 4 additions & 0 deletions crm_claim/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Fernando La Chica &lt;<a class="reference external" href="mailto:fernando.lachica&#64;guadaltech.es">fernando.lachica&#64;guadaltech.es</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Bernat Obrador &lt;<a class="reference external" href="mailto:bobrador&#64;apsl.net">bobrador&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
10 changes: 5 additions & 5 deletions crm_claim/views/crm_claim_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<field name="date" />
<field name="stage_id" groups="base.group_user" />
<field name="categ_id" string="Type" />
<field name="date_deadline" invisible="1" />
<field name="date_closed" invisible="1" />
<field name="date_deadline" column_invisible="1" />
<field name="date_closed" column_invisible="1" readonly="1" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
Expand Down Expand Up @@ -73,9 +73,9 @@
<page string="Follow Up" groups="base.group_user">
<group colspan="2" col="2" groups="base.group_no_one">
<separator colspan="2" string="Dates" />
<field name="create_date" />
<field name="date_closed" invisible="1" />
<field name="write_date" />
<field name="create_date" readonly="1" />
<field name="date_closed" invisible="1" readonly="1" />
<field name="write_date" readonly="1" />
</group>
<group colspan="2" col="2">
<separator colspan="2" string="Root Causes" />
Expand Down
2 changes: 1 addition & 1 deletion crm_claim/views/res_partner_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<button
class="oe_stat_button"
type="action"
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
context="{'search_default_partner_id': id, 'default_partner_id': id}"
name="%(crm_claim_category_claim0)d"
icon="fa-comments"
groups="sales_team.group_sale_salesman"
Expand Down

0 comments on commit b638ae0

Please sign in to comment.