diff --git a/repair_order_cost/__init__.py b/repair_order_cost/__init__.py
index b9ceb0c..3e956f6 100644
--- a/repair_order_cost/__init__.py
+++ b/repair_order_cost/__init__.py
@@ -11,7 +11,7 @@ def _post_install_put_cost_in_repair_orders(cr, registry):
for repair in repairs:
for operation in repair.operations:
operation.material_cost = (
- operation.product_uom_qty * operation.product_id.standard_price)
+ operation.product_uom_qty * operation.product_id.standard_price
+ )
for line in repair.fees_lines:
- line.operations_cost = (
- line.product_uom_qty * line.product_id.standard_price)
+ line.operations_cost = line.product_uom_qty * line.product_id.standard_price
diff --git a/repair_order_cost/__manifest__.py b/repair_order_cost/__manifest__.py
index 2f00869..9f28f38 100644
--- a/repair_order_cost/__manifest__.py
+++ b/repair_order_cost/__manifest__.py
@@ -6,11 +6,8 @@
"category": "Inventory/Inventory",
"license": "AGPL-3",
"author": "AvanzOSC",
- "website": "https://www.avanzosc.es",
- "depends": [
- "product",
- "repair"
- ],
+ "website": "https://github.com/avanzosc/mrp-repair-addons",
+ "depends": ["product", "repair"],
"data": [
"security/repair_order_cost_groups.xml",
"views/repair_order_views.xml",
diff --git a/repair_order_cost/models/repair_fee.py b/repair_order_cost/models/repair_fee.py
index fcf965b..6145d21 100644
--- a/repair_order_cost/models/repair_fee.py
+++ b/repair_order_cost/models/repair_fee.py
@@ -6,16 +6,13 @@
class RepairFee(models.Model):
_inherit = "repair.fee"
- operations_cost = fields.Float(
- string="Operations cost", digits="Product Price"
- )
+ operations_cost = fields.Float(string="Operations cost", digits="Product Price")
@api.onchange("repair_id", "product_id", "product_uom_qty")
def onchange_product_id(self):
result = super(RepairFee, self).onchange_product_id()
operations_cost = 0
if self.product_id:
- operations_cost = (
- self.product_uom_qty * self.product_id.standard_price)
+ operations_cost = self.product_uom_qty * self.product_id.standard_price
self.operations_cost = operations_cost
return result
diff --git a/repair_order_cost/models/repair_line.py b/repair_order_cost/models/repair_line.py
index b082572..2c785b9 100644
--- a/repair_order_cost/models/repair_line.py
+++ b/repair_order_cost/models/repair_line.py
@@ -6,16 +6,13 @@
class RepairLine(models.Model):
_inherit = "repair.line"
- material_cost = fields.Float(
- string="Material cost", digits="Product Price"
- )
+ material_cost = fields.Float(string="Material cost", digits="Product Price")
@api.onchange("repair_id", "product_id", "product_uom_qty")
def onchange_product_id(self):
result = super(RepairLine, self).onchange_product_id()
material_cost = 0
if self.type and self.type == "add" and self.product_id:
- material_cost = (
- self.product_uom_qty * self.product_id.standard_price)
+ material_cost = self.product_uom_qty * self.product_id.standard_price
self.material_cost = material_cost
return result
diff --git a/repair_order_cost/models/repair_order.py b/repair_order_cost/models/repair_order.py
index 946b58f..d0ddaf0 100644
--- a/repair_order_cost/models/repair_order.py
+++ b/repair_order_cost/models/repair_order.py
@@ -7,30 +7,41 @@ class RepairOrder(models.Model):
_inherit = "repair.order"
material_cost = fields.Float(
- string="Material cost", digits="Product Price",
- compute="_compute_repair_costs", store=True, copy=False
+ string="Material cost",
+ digits="Product Price",
+ compute="_compute_repair_costs",
+ store=True,
+ copy=False,
)
operations_cost = fields.Float(
- string="Operations cost", digits="Product Price",
- compute="_compute_repair_costs", store=True, copy=False
+ string="Operations cost",
+ digits="Product Price",
+ compute="_compute_repair_costs",
+ store=True,
+ copy=False,
)
total_repair_cost = fields.Float(
- string="Total repair cost", digits="Product Price",
- compute="_compute_repair_costs", store=True, copy=False
+ string="Total repair cost",
+ digits="Product Price",
+ compute="_compute_repair_costs",
+ store=True,
+ copy=False,
)
- @api.depends("operations", "operations.material_cost",
- "fees_lines", "fees_lines.operations_cost")
+ @api.depends(
+ "operations",
+ "operations.material_cost",
+ "fees_lines",
+ "fees_lines.operations_cost",
+ )
def _compute_repair_costs(self):
for repair in self:
material_cost = 0
operations_cost = 0
if repair.operations:
- material_cost = sum(
- repair.operations.mapped("material_cost"))
+ material_cost = sum(repair.operations.mapped("material_cost"))
if repair.fees_lines:
- operations_cost = sum(
- repair.fees_lines.mapped("operations_cost"))
+ operations_cost = sum(repair.fees_lines.mapped("operations_cost"))
repair.material_cost = material_cost
repair.operations_cost = operations_cost
repair.total_repair_cost = material_cost + operations_cost
diff --git a/repair_order_cost/security/repair_order_cost_groups.xml b/repair_order_cost/security/repair_order_cost_groups.xml
index 5593fae..5c3dd0d 100644
--- a/repair_order_cost/security/repair_order_cost_groups.xml
+++ b/repair_order_cost/security/repair_order_cost_groups.xml
@@ -2,6 +2,9 @@
Show repair order costs
-
+
diff --git a/repair_order_cost/views/repair_order_views.xml b/repair_order_cost/views/repair_order_views.xml
index 9d17d49..c64324f 100644
--- a/repair_order_cost/views/repair_order_views.xml
+++ b/repair_order_cost/views/repair_order_views.xml
@@ -4,34 +4,60 @@
repair.order
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
@@ -43,15 +69,24 @@
-
-
-
+
+
+