-
Notifications
You must be signed in to change notification settings - Fork 24
[14.0][ADD] crm_claim_repair: One to many from claims to reair orders. #95
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
Open
Berezi
wants to merge
1
commit into
avanzosc:14.0
Choose a base branch
from
Berezi:crm-addons14-crm_claim_repair
base: 14.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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,29 @@ | ||
| .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
|
|
||
| ================ | ||
| CRM Claim Repair | ||
| ================ | ||
|
|
||
| * One to many from claims to Repair Orders. | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues | ||
| <https://github.com/avanzosc/crm-addons/issues>`_. In case of trouble, | ||
| please check there if your issue has already been reported. If you spotted | ||
| it first, help us smash it by providing detailed and welcomed feedback. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| * Berezi Amubieta <[email protected]> | ||
| * Alfredo de la Fuente <[email protected]> | ||
| * Ana Juaristi <[email protected]> |
This file contains hidden or 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 @@ | ||
| from . import models |
This file contains hidden or 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,20 @@ | ||
| # Copyright 2021 Berezi Amubieta - AvanzOSC | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| { | ||
| "name": "CRM Claim Repair", | ||
| 'version': '14.0.1.0.0', | ||
| "author": "Avanzosc", | ||
| "category": "Sales/CRM", | ||
| "depends": [ | ||
| "repair", | ||
| "crm_claim", | ||
| "crm_claim_usability" | ||
| ], | ||
| "data": [ | ||
| "views/repair_order_views.xml", | ||
| "views/crm_claim_views.xml", | ||
| ], | ||
| "license": "AGPL-3", | ||
| 'installable': True, | ||
| "auto_install": True, | ||
| } |
This file contains hidden or 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,58 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * crm_claim_repair | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 14.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2021-11-18 13:21+0000\n" | ||
| "PO-Revision-Date: 2021-11-18 13:21+0000\n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__repair_count | ||
| msgid "# Repair Orders" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model,name:crm_claim_repair.model_crm_claim | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__claim_id | ||
| msgid "Claim" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__display_name | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__display_name | ||
| msgid "Display Name" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__id | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__id | ||
| msgid "ID" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim____last_update | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order____last_update | ||
| msgid "Last Modified on" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model,name:crm_claim_repair.model_repair_order | ||
| msgid "Repair Order" | ||
| msgstr "" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: code:addons/crm_claim_repair/models/crm_claim.py:0 | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__repair_ids | ||
| #: model_terms:ir.ui.view,arch_db:crm_claim_repair.crm_case_claims_form_view | ||
| #, python-format | ||
| msgid "Repair Orders" | ||
| msgstr "" |
This file contains hidden or 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,58 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * crm_claim_repair | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 14.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2021-11-18 13:21+0000\n" | ||
| "PO-Revision-Date: 2021-11-18 13:21+0000\n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__repair_count | ||
| msgid "# Repair Orders" | ||
| msgstr "# Órdenes de reparación" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model,name:crm_claim_repair.model_crm_claim | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__claim_id | ||
| msgid "Claim" | ||
| msgstr "Reclamación" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__display_name | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__display_name | ||
| msgid "Display Name" | ||
| msgstr "Nombre para mostrar" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__id | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order__id | ||
| msgid "ID" | ||
| msgstr "Identificador" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim____last_update | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_repair_order____last_update | ||
| msgid "Last Modified on" | ||
| msgstr "Última modificación el" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: model:ir.model,name:crm_claim_repair.model_repair_order | ||
| msgid "Repair Order" | ||
| msgstr "Orden de reparación" | ||
|
|
||
| #. module: crm_claim_repair | ||
| #: code:addons/crm_claim_repair/models/crm_claim.py:0 | ||
| #: model:ir.model.fields,field_description:crm_claim_repair.field_crm_claim__repair_ids | ||
| #: model_terms:ir.ui.view,arch_db:crm_claim_repair.crm_case_claims_form_view | ||
| #, python-format | ||
| msgid "Repair Orders" | ||
| msgstr "Orden de reparación" |
This file contains hidden or 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,2 @@ | ||
| from . import repair_order | ||
| from . import crm_claim |
This file contains hidden or 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,29 @@ | ||
| # Copyright 2021 Berezi Amubieta - AvanzOSC | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| from odoo import models, fields, _ | ||
|
|
||
|
|
||
| class CrmClaim(models.Model): | ||
| _inherit = 'crm.claim' | ||
|
|
||
| def _compute_repair_count(self): | ||
| for claim in self: | ||
| claim.repair_count = len(claim.repair_ids) | ||
|
|
||
| repair_ids = fields.One2many( | ||
| string='Repair Orders', comodel_name='repair.order', | ||
| inverse_name='claim_id') | ||
| repair_count = fields.Integer( | ||
| '# Repair Orders', compute='_compute_repair_count') | ||
|
|
||
| def action_view_repair(self): | ||
| context = self.env.context.copy() | ||
| context.update({'default_claim_id': self.id}) | ||
| return { | ||
| 'name': _("Repair Orders"), | ||
| 'view_mode': 'tree,form', | ||
| 'res_model': 'repair.order', | ||
| 'domain': [('id', 'in', self.repair_ids.ids)], | ||
| 'type': 'ir.actions.act_window', | ||
| 'context': context | ||
| } |
This file contains hidden or 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,10 @@ | ||
| # Copyright 2021 Berezi Amubieta - AvanzOSC | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class RepairOrder(models.Model): | ||
| _inherit = 'repair.order' | ||
|
|
||
| claim_id = fields.Many2one( | ||
| string='Claim', comodel_name='crm.claim') | ||
This file contains hidden or 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,15 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
|
|
||
| <odoo> | ||
| <record id="crm_case_claims_form_view" model="ir.ui.view"> | ||
| <field name="model">crm.claim</field> | ||
| <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/> | ||
| <field name="arch" type="xml"> | ||
| <div name="button_box" position="inside"> | ||
| <button class="oe_stat_button" icon="fa-wrench" type="object" name="action_view_repair"> | ||
| <field string="Repair Orders" name="repair_count" widget="statinfo"/> | ||
| </button> | ||
| </div> | ||
| </field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or 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,13 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
|
|
||
| <odoo> | ||
| <record id="view_repair_order_form" model="ir.ui.view"> | ||
| <field name="model">repair.order</field> | ||
| <field name="inherit_id" ref="repair.view_repair_order_form"/> | ||
| <field name="arch" type="xml"> | ||
| <field name="user_id" position="after"> | ||
| <field name="claim_id" domain="['|', ('partner_id','=', False), ('partner_id', '=', partner_id)]"/> | ||
| </field> | ||
| </field> | ||
| </record> | ||
| </odoo> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.