Skip to content

Commit

Permalink
modif order, sequnence (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
danila12 authored Jul 29, 2024
1 parent aa74376 commit a992e20
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 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:/dhongu.png?size=30px)](https:/dhongu) | Service Consumable | Free
[deltatech_service_equipment](deltatech_service_equipment/) | 14.0.1.2.0 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Service Equipment Management | Free
[deltatech_service_equipment_base](deltatech_service_equipment_base/) | 14.0.1.1.3 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Service Equipment Management | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.1.4 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.1.5 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance_agreement](deltatech_service_maintenance_agreement/) | 14.0.1.0.4 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance_plan](deltatech_service_maintenance_plan/) | 14.0.1.0.6 | [![dhongu](https:/dhongu.png?size=30px)](https:/dhongu) | Services Maintenance Plan | Free
[deltatech_sms](deltatech_sms/) | 14.0.1.0.0 | [![dhongu](https:/dhongu.png?size=30px)](https:/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:f0381c9f50a805a1f567df81f38596a76b431067e0b80a306c916284187889e2
!! source digest: sha256:e791fa056522374453c7cc5157463e12b83e3fea07375cbde3d1d03b46dbe82f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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.1.4",
"version": "14.0.1.1.5",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"category": "Services/Maintenance",
Expand Down
9 changes: 7 additions & 2 deletions deltatech_service_maintenance/models/service_warranty.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def set_new(self):
def set_in_progress(self):
if self.state == "assigned" and self.user_id:
self.with_context(change_ok=True).write({"state": "progress"})
if self.name == "/":
self.name = self.env["ir.sequence"].next_by_code("service.warranty")

def request_approval(self):
self.with_context(change_ok=True).write({"state": "approval_requested"})
Expand All @@ -206,6 +204,13 @@ def approve(self):
def set_done(self):
self.with_context(change_ok=True).write({"state": "done"})

@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if "name" not in vals or ("name" in vals and vals["name"] == "/"):
vals["name"] = self.env["ir.sequence"].next_by_code("service.warranty")
return super().create(vals_list)

def write(self, vals):
if (
"state" in vals
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:f0381c9f50a805a1f567df81f38596a76b431067e0b80a306c916284187889e2
!! source digest: sha256:e791fa056522374453c7cc5157463e12b83e3fea07375cbde3d1d03b46dbe82f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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:/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
5 changes: 3 additions & 2 deletions deltatech_service_maintenance/views/service_warranty_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<field name="arch" type="xml">
<tree
string="Warranty"
default_order="date desc"
default_order="create_date desc"
sample="1"
decoration-info="state == 'new'"
decoration-danger="state == 'approval_requested'"
Expand All @@ -16,8 +16,9 @@
decoration-primary="state == 'new'"
decoration-warning="state == 'progress'"
>
<field name="create_date" optional="show" />
<field name="name" decoration-bf="1" />
<field name="date" />
<field name="date" optional="show" />
<field name="equipment_id" />
<field name="sale_order_id" />
<field name="partner_id" />
Expand Down

0 comments on commit a992e20

Please sign in to comment.