Skip to content

Commit

Permalink
added warranty type (#1842)
Browse files Browse the repository at this point in the history
  • Loading branch information
danila12 authored Nov 16, 2024
1 parent 65ee06c commit c278d35
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ addon | version | maintainers | summary | price
[deltatech_service_consumable](deltatech_service_consumable/) | 14.0.1.1.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Consumable | Free
[deltatech_service_equipment](deltatech_service_equipment/) | 14.0.1.2.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free
[deltatech_service_equipment_base](deltatech_service_equipment_base/) | 14.0.1.1.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.2.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.3.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance_agreement](deltatech_service_maintenance_agreement/) | 14.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance_plan](deltatech_service_maintenance_plan/) | 14.0.1.0.6 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance Plan | Free
[deltatech_sms](deltatech_sms/) | 14.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Send SMS to custom endpoint | Free
Expand Down
2 changes: 1 addition & 1 deletion deltatech_service_maintenance/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deltatech Services Maintenance
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8b87deee85e6ca9bd9c55794cf9e2351e810f53733a9b37ec964e989292115f2
!! source digest: sha256:3f1fb31bc4a5a478c95f4ab2f049b080070e4d2fcdc153c174fb89df932244cf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
2 changes: 1 addition & 1 deletion deltatech_service_maintenance/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Deltatech Services Maintenance",
"summary": "Services Maintenance",
"version": "14.0.1.2.0",
"version": "14.0.1.3.0",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"category": "Services/Maintenance",
Expand Down
15 changes: 14 additions & 1 deletion deltatech_service_maintenance/models/service_warranty.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
from odoo.exceptions import UserError
from odoo.tools.safe_eval import safe_eval

# flux garantii
# flux garantii si reconditionari


class ServiceWarranty(models.Model):
_name = "service.warranty"
_description = "Warranty"
_inherit = ["mail.thread", "mail.activity.mixin"]

type = fields.Selection([("warranty", "Warranty"), ("recondition", "Recondition")])
name = fields.Char(string="Reference", readonly=True, index=True, default="/", copy=False)
date = fields.Datetime(
string="Date", default=fields.Date.context_today, readonly=True, states={"new": [("readonly", False)]}
Expand All @@ -32,6 +33,18 @@ class ServiceWarranty(models.Model):
string="Status",
tracking=True,
)

rec_state = fields.Selection(
[
("new", "New"),
("progress", "In Progress"),
("done", "Done"),
],
default="new",
string="Status",
tracking=True,
)

clarifications_state = fields.Selection(
[("required", "Required"), ("sent", "Sent")], string="Clarifications", tracking=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ <h1 class="title">Deltatech Services Maintenance</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8b87deee85e6ca9bd9c55794cf9e2351e810f53733a9b37ec964e989292115f2
!! source digest: sha256:3f1fb31bc4a5a478c95f4ab2f049b080070e4d2fcdc153c174fb89df932244cf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/14.0/deltatech_service_maintenance"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<dl class="docutils">
Expand Down
39 changes: 35 additions & 4 deletions deltatech_service_maintenance/views/service_warranty_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,19 @@
string="Set done"
attrs="{'invisible': [('state','!=','approved')]}"
/>
<field name="state" widget="statusbar" options="{'clickable': '1'}" />
<field name="type" invisible="1" />
<field
name="state"
widget="statusbar"
options="{'clickable': '1'}"
attrs="{'invisible': [('type','!=','warranty')]}"
/>
<field
name="rec_state"
widget="statusbar"
options="{'clickable': '1'}"
attrs="{'invisible': [('type','!=','recondition')]}"
/>
</header>
<sheet>
<div class="oe_title">
Expand All @@ -108,8 +120,8 @@
/>
</group>
<group>
<field name="sale_order_id" />
<field name="invoice_id" />
<field name="sale_order_id" attrs="{'invisible': [('type','!=','warranty')]}" />
<field name="invoice_id" attrs="{'invisible': [('type','!=','warranty')]}" />
</group>
<group name="responsible">
<field
Expand All @@ -124,7 +136,7 @@
<field name="has_agreement" />
</group>
<group>
<field name="picking_id" readonly="1" />
<field name="picking_id" readonly="1" attrs="{'invisible': [('type','!=','warranty')]}" />
</group>
<group name="clarifications">
<field
Expand Down Expand Up @@ -254,6 +266,8 @@
<field name="name">Warranty</field>
<field name="res_model">service.warranty</field>
<field name="view_mode">tree,form,activity</field>
<field name="domain">[('type', '=', 'warranty')]</field>
<field name="context">{'default_type': 'warranty'}</field>
</record>
<menuitem
name="Warranty"
Expand All @@ -263,4 +277,21 @@
groups="deltatech_service.group_warranty_user"
/>



<record id="action_service_recondition" model="ir.actions.act_window">
<field name="name">Reconditions</field>
<field name="res_model">service.warranty</field>
<field name="view_mode">tree,form,activity</field>
<field name="domain">[('type', '=', 'recondition')]</field>
<field name="context">{'default_type': 'recondition'}</field>
</record>
<menuitem
name="Reconditions"
id="menu_service_recondition"
action="action_service_recondition"
parent="deltatech_service.menu_service"
groups="deltatech_service.group_warranty_user"
/>

</odoo>

0 comments on commit c278d35

Please sign in to comment.