Bugfix in double unit of measures in sales
bzr revid: fp@tinyerp.com-1a2673b1bb51821365569d090157bcb1cbc35266
This commit is contained in:
parent
fcd1b1d9af
commit
04e512005b
|
@ -2,7 +2,9 @@
|
|||
<terp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
<menuitem name="Project Management" id="menu_main" icon="terp-project"/>
|
||||
-->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_account_analytic_managed">
|
||||
<field name="name">My managed accounts</field>
|
||||
|
@ -12,7 +14,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/My managed accounts"
|
||||
name="Project Management/Analytic accounts/My managed accounts"
|
||||
id="menu_analytic_account_managed"
|
||||
action="action_account_analytic_managed" />
|
||||
|
||||
|
@ -36,7 +38,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/My managed accounts/"
|
||||
name="Project Management/Analytic accounts/My managed accounts/"
|
||||
id="menu_analytic_account_to_valid_open"
|
||||
action="action_account_analytic_managed_open" />
|
||||
|
||||
|
@ -48,7 +50,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/My managed accounts/"
|
||||
name="Project Management/Analytic accounts/My managed accounts/"
|
||||
id="menu_analytic_account_to_valid_pending"
|
||||
action="action_account_analytic_managed_pending" />
|
||||
|
||||
|
@ -60,7 +62,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/Overpassed accounts"
|
||||
name="Project Management/Analytic accounts/Overpassed accounts"
|
||||
id="menu_action_account_analytic_managed_overpassed"
|
||||
action="action_account_analytic_managed_overpassed" />
|
||||
|
||||
|
@ -73,7 +75,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/"
|
||||
name="Project Management/Analytic accounts/"
|
||||
id="menu_action_account_analytic_all"
|
||||
action="action_account_analytic_all" />
|
||||
|
||||
|
@ -86,7 +88,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/All analytic accounts/"
|
||||
name="Project Management/Analytic accounts/All analytic accounts/"
|
||||
id="menu_action_account_analytic_all_draft"
|
||||
action="action_account_analytic_all_draft" />
|
||||
|
||||
|
@ -99,7 +101,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/All analytic accounts/"
|
||||
name="Project Management/Analytic accounts/All analytic accounts/"
|
||||
id="menu_action_account_analytic_all_open"
|
||||
action="action_account_analytic_all_open" />
|
||||
|
||||
|
@ -112,7 +114,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/All analytic accounts/"
|
||||
name="Project Management/Analytic accounts/All analytic accounts/"
|
||||
id="menu_action_account_analytic_all_pending"
|
||||
action="action_account_analytic_all_pending" />
|
||||
|
||||
|
@ -125,7 +127,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Project/Analytic accounts/All analytic accounts/"
|
||||
name="Project Management/Analytic accounts/All analytic accounts/"
|
||||
id="menu_action_account_analytic_all_simplified"
|
||||
action="action_account_analytic_all_simplified" />
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
"hr_timesheet_project",
|
||||
"crm",
|
||||
"project",
|
||||
"board_project"
|
||||
"board_project",
|
||||
"account_analytic_analysis"
|
||||
],
|
||||
#"board_project",
|
||||
#"board_account"],
|
||||
|
|
|
@ -85,7 +85,7 @@ class sale_order(osv.osv):
|
|||
val = 0.0
|
||||
cur=order.pricelist_id.currency_id
|
||||
for line in order.order_line:
|
||||
for c in self.pool.get('account.tax').compute(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uos_qty, order.partner_invoice_id.id, line.product_id, order.partner_id):
|
||||
for c in self.pool.get('account.tax').compute(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, order.partner_invoice_id.id, line.product_id, order.partner_id):
|
||||
val+= cur_obj.round(cr, uid, cur, c['amount'])
|
||||
res[order.id]=cur_obj.round(cr, uid, cur, val)
|
||||
return res
|
||||
|
@ -509,10 +509,7 @@ class sale_order_line(osv.osv):
|
|||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
for line in self.browse(cr, uid, ids):
|
||||
if line.product_uos.id:
|
||||
res[line.id] = line.price_unit * line.product_uos_qty * (1 - (line.discount or 0.0) /100.0)
|
||||
else:
|
||||
res[line.id] = line.price_unit * line.product_uom_qty * (1 - (line.discount or 0.0) / 100.0)
|
||||
res[line.id] = line.price_unit * line.product_uom_qty * (1 - (line.discount or 0.0) / 100.0)
|
||||
cur = line.order_id.pricelist_id.currency_id
|
||||
res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
|
||||
return res
|
||||
|
@ -592,10 +589,13 @@ class sale_order_line(osv.osv):
|
|||
a = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
|
||||
uosqty = _get_line_qty(line)
|
||||
uos_id = (line.product_uos and line.product_uos.id) or line.product_uom.id
|
||||
pu = line.price_unit
|
||||
if line.product_uos_qty:
|
||||
pu = round(pu* line.product_uom_qty /line.product_uos_qty, 2)
|
||||
inv_id = self.pool.get('account.invoice.line').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'account_id': a,
|
||||
'price_unit': line.price_unit,
|
||||
'price_unit': pu,
|
||||
'quantity': uosqty,
|
||||
'discount': line.discount,
|
||||
'uos_id': uos_id,
|
||||
|
|
Loading…
Reference in New Issue