Skip to content

Commit

Permalink
recondition state, picking
Browse files Browse the repository at this point in the history
  • Loading branch information
danila12 committed Feb 18, 2025
1 parent 987c418 commit b27c58a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ addon | version | maintainers | summary | price
[deltatech_service_consumable](deltatech_service_consumable/) | 17.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/) | 17.0.1.1.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free
[deltatech_service_equipment_base](deltatech_service_equipment_base/) | 17.0.1.1.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 17.0.1.1.7 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance](deltatech_service_maintenance/) | 17.0.1.1.9 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free
[deltatech_service_maintenance_agreement](deltatech_service_maintenance_agreement/) | 17.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/) | 17.0.1.0.6 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance Plan | Free
[deltatech_sms](deltatech_sms/) | 17.0.1.0.1 | [![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/__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": "17.0.1.1.7",
"version": "17.0.1.1.9",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"category": "Services/Maintenance",
Expand Down
3 changes: 3 additions & 0 deletions deltatech_service_maintenance/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ class ResConfigSettings(models.TransientModel):
picking_type_for_warranty = fields.Many2one(
"stock.picking.type", string="Warranty picking type", config_parameter="service.picking_type_for_warranty"
)
picking_type_for_recondition = fields.Many2one(
"stock.picking.type", string="Recondition picking type", config_parameter="service.picking_type_for_recondition"
)
7 changes: 5 additions & 2 deletions deltatech_service_maintenance/models/service_warranty.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ def new_delivery_button(self):
if self.partner_id.parent_id:
if self.partner_id.parent_id.picking_warn == "block":
raise UserError(self.partner_id.parent_id.picking_warn_msg)

picking_type_id = False
get_param = self.env["ir.config_parameter"].sudo().get_param
picking_type_id = safe_eval(get_param("service.picking_type_for_warranty", "False"))
if self.type == "warranty":
picking_type_id = safe_eval(get_param("service.picking_type_for_warranty", "False"))
elif self.type == "recondition":
picking_type_id = safe_eval(get_param("service.picking_type_for_recondition", "False"))
if picking_type_id:
picking_type = self.env["stock.picking.type"].browse(picking_type_id)
else:
Expand Down
11 changes: 11 additions & 0 deletions deltatech_service_maintenance/views/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
</div>
</div>
</div>
<div class="o_setting_right_pane">
<label for="picking_type_for_recondition" />
<div class="text-muted">
Picking type for reconditions transfers.
</div>
<div class="content-group">
<div class="mt16">
<field name="picking_type_for_recondition" class="o_light_label" widget="selection" />
</div>
</div>
</div>
</div>


Expand Down
15 changes: 2 additions & 13 deletions deltatech_service_maintenance/views/service_warranty_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,7 @@
invisible="state != 'approved'"
/>
<field name="type" invisible="1" />
<field
name="state"
widget="statusbar"
options="{'clickable': '1'}"
invisible="type != 'warranty'"
/>
<field
name="rec_state"
widget="statusbar"
options="{'clickable': '1'}"
invisible="type != 'recondition'"
/>
<field name="state" widget="statusbar" options="{'clickable': '1'}" />
</header>
<sheet>
<div class="oe_title">
Expand Down Expand Up @@ -140,7 +129,7 @@
<field name="state" groups="deltatech_service_base.group_warranty_manager" />
</group>
<group>
<field name="picking_id" readonly="1" invisible="type != 'warranty'" />
<field name="picking_id" readonly="1" />
/>
</group>
<group name="clarifications">
Expand Down

0 comments on commit b27c58a

Please sign in to comment.