update report
This commit is contained in:
parent
6391825a36
commit
74c29ffc45
|
|
@ -37,6 +37,13 @@ class MrpProduction(models.Model):
|
||||||
return moves
|
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):
|
class MrpBomLine(models.Model):
|
||||||
_inherit = 'mrp.bom.line'
|
_inherit = 'mrp.bom.line'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class SaleOrderLine(models.Model):
|
||||||
digits='Product Price', store=True, readonly=False, precompute=True,
|
digits='Product Price', store=True, readonly=False, precompute=True,
|
||||||
groups="base.group_user")
|
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):
|
def _compute_bag_weight(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
line.bag_weight = line.product_id.weight * line.product_uom_qty
|
line.bag_weight = line.product_id.weight * line.product_uom_qty
|
||||||
|
|
|
||||||
|
|
@ -137,12 +137,12 @@ class SamashtiDashboard(models.AbstractModel):
|
||||||
('date_order', '>=', fromDate),
|
('date_order', '>=', fromDate),
|
||||||
('date_order', '<=', toDate)
|
('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:
|
for r in sale_orders:
|
||||||
cost = r['total_production_cost']
|
cost = r['total_production_cost']
|
||||||
sale_price = r['amount_total']
|
sale_price = r['amount_untaxed']
|
||||||
margin = sale_price - cost
|
margin = sale_price - cost
|
||||||
margin_percent = (margin / sale_price * 100) if sale_price else 0.0
|
margin_percent = (margin / sale_price * 100) if sale_price else 0.0
|
||||||
customer = r['partner_id'][-1]
|
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'):
|
for line in sale_order.order_line.filtered(lambda l: l.product_id.type == 'consu'):
|
||||||
line_cost = line.purchase_price or 0
|
line_cost = line.purchase_price or 0
|
||||||
cost += line_cost * line.product_uom_qty
|
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):
|
for line in sale_order.order_line.filtered(lambda l: l.product_id.type == 'service' and l.price_total > 0):
|
||||||
cost += line.price_total
|
cost += line.price_total
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ from datetime import datetime
|
||||||
class AssetDetail(models.Model):
|
class AssetDetail(models.Model):
|
||||||
_name = "asset.detail"
|
_name = "asset.detail"
|
||||||
_description = "Asset Detail"
|
_description = "Asset Detail"
|
||||||
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||||
|
|
||||||
name = fields.Char(string="Name")
|
name = fields.Char(string="Name")
|
||||||
asset_image = fields.Binary(string="Image")
|
asset_image = fields.Binary(string="Image")
|
||||||
|
|
@ -20,6 +21,7 @@ class AssetDetail(models.Model):
|
||||||
warranty_start = fields.Date(string="Warranty Start")
|
warranty_start = fields.Date(string="Warranty Start")
|
||||||
warranty_end = fields.Date(string="Warranty End")
|
warranty_end = fields.Date(string="Warranty End")
|
||||||
note = fields.Html(string="Note")
|
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")
|
state = fields.Selection([('draft', 'New'), ('active', 'Active'), ('scrap', 'Scrap')], string='State', default="draft")
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<field name="purchase_date"/>
|
<field name="purchase_date"/>
|
||||||
<field name="purchase_value"/>
|
<field name="purchase_value"/>
|
||||||
<field name="location_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
<field name="location_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||||
<!-- <field name="employee_id" options="{'no_create_edit': True, 'no_create': True}"/>-->
|
<field name="quantity"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
|
|
@ -55,6 +55,7 @@
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
|
<chatter/>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="vendor_id" readonly="state != 'draft'"/>
|
<field name="vendor_id" readonly="state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||||
<field name="location_id" readonly="state != 'draft'"/>
|
<field name="location_id" readonly="state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="date" readonly="state != 'draft'"/>
|
<field name="date" readonly="state != 'draft'"/>
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<create string="Add a line"/>
|
<create string="Add a line"/>
|
||||||
<button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
|
<button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
|
||||||
</control>
|
</control>
|
||||||
<field name="product_id" readonly="parent.state != 'draft'"/>
|
<field name="product_id" readonly="parent.state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||||
<field name="quantity" readonly="parent.state != 'draft'"/>
|
<field name="quantity" readonly="parent.state != 'draft'"/>
|
||||||
<field name="product_uom_id" readonly="1" string="UoM"/>
|
<field name="product_uom_id" readonly="1" string="UoM"/>
|
||||||
<field name="price" readonly="parent.state != 'draft'"/>
|
<field name="price" readonly="parent.state != 'draft'"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue