diff --git a/custom_addons/costing_mrp_bom/models/mrp.py b/custom_addons/costing_mrp_bom/models/mrp.py index cea564d3a..af4c5ab1e 100644 --- a/custom_addons/costing_mrp_bom/models/mrp.py +++ b/custom_addons/costing_mrp_bom/models/mrp.py @@ -37,6 +37,13 @@ class MrpProduction(models.Model): return moves + def action_confirm(self): + res = super(MrpProduction,self).action_confirm() + for rec in self: + rec.product_id.button_bom_cost() + return res + + class MrpBomLine(models.Model): _inherit = 'mrp.bom.line' diff --git a/custom_addons/costing_mrp_bom/models/sale_order_line.py b/custom_addons/costing_mrp_bom/models/sale_order_line.py index 3c3e498f8..1c16b5dd8 100644 --- a/custom_addons/costing_mrp_bom/models/sale_order_line.py +++ b/custom_addons/costing_mrp_bom/models/sale_order_line.py @@ -68,7 +68,7 @@ class SaleOrderLine(models.Model): digits='Product Price', store=True, readonly=False, precompute=True, groups="base.group_user") - @api.depends('product_id', 'company_id', 'product_uom') + @api.depends('product_id', 'company_id', 'product_uom','product_uom_qty') def _compute_bag_weight(self): for line in self: line.bag_weight = line.product_id.weight * line.product_uom_qty diff --git a/custom_addons/dashboard/models/stock_dashboard.py b/custom_addons/dashboard/models/stock_dashboard.py index cb1949197..31f55d0f7 100644 --- a/custom_addons/dashboard/models/stock_dashboard.py +++ b/custom_addons/dashboard/models/stock_dashboard.py @@ -137,12 +137,12 @@ class SamashtiDashboard(models.AbstractModel): ('date_order', '>=', fromDate), ('date_order', '<=', toDate) ], - ['id', 'name', 'amount_total', 'partner_id', 'total_production_cost','date_order'] + ['id', 'name', 'amount_untaxed', 'partner_id', 'total_production_cost','date_order'] ) for r in sale_orders: cost = r['total_production_cost'] - sale_price = r['amount_total'] + sale_price = r['amount_untaxed'] margin = sale_price - cost margin_percent = (margin / sale_price * 100) if sale_price else 0.0 customer = r['partner_id'][-1] @@ -209,7 +209,6 @@ class SamashtiDashboard(models.AbstractModel): for line in sale_order.order_line.filtered(lambda l: l.product_id.type == 'consu'): line_cost = line.purchase_price or 0 cost += line_cost * line.product_uom_qty - for line in sale_order.order_line.filtered(lambda l: l.product_id.type == 'service' and l.price_total > 0): cost += line.price_total diff --git a/custom_addons/fixed_asset_management/models/asset_detail.py b/custom_addons/fixed_asset_management/models/asset_detail.py index 397211c93..6e1272738 100644 --- a/custom_addons/fixed_asset_management/models/asset_detail.py +++ b/custom_addons/fixed_asset_management/models/asset_detail.py @@ -5,6 +5,7 @@ from datetime import datetime class AssetDetail(models.Model): _name = "asset.detail" _description = "Asset Detail" + _inherit = ['mail.thread', 'mail.activity.mixin'] name = fields.Char(string="Name") asset_image = fields.Binary(string="Image") @@ -20,6 +21,7 @@ class AssetDetail(models.Model): warranty_start = fields.Date(string="Warranty Start") warranty_end = fields.Date(string="Warranty End") note = fields.Html(string="Note") + quantity = fields.Float('Quantity', default=1.0, copy=False, tracking=True) state = fields.Selection([('draft', 'New'), ('active', 'Active'), ('scrap', 'Scrap')], string='State', default="draft") @api.model diff --git a/custom_addons/fixed_asset_management/views/asset_detail_view.xml b/custom_addons/fixed_asset_management/views/asset_detail_view.xml index 4e755786b..8f04dbb66 100644 --- a/custom_addons/fixed_asset_management/views/asset_detail_view.xml +++ b/custom_addons/fixed_asset_management/views/asset_detail_view.xml @@ -40,7 +40,7 @@ - + @@ -55,6 +55,7 @@ + diff --git a/custom_addons/grn/views/grn_views.xml b/custom_addons/grn/views/grn_views.xml index 04a36c261..4416d9801 100644 --- a/custom_addons/grn/views/grn_views.xml +++ b/custom_addons/grn/views/grn_views.xml @@ -28,8 +28,8 @@ - - + + @@ -47,7 +47,7 @@