[MERGE] pap branch for account invoice usebility task (uom onchange) and timesheet lines working hours
bzr revid: mra@mra-laptop-20100608114424-nikplga0apj96prq
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
<notebook>
|
||||
<page string="Line">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
|
||||
<field name="uos_id"/>
|
||||
<field name="uos_id" widget="selection" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount"/>
|
||||
|
||||
@@ -1300,7 +1300,7 @@ class account_invoice_line(osv.osv):
|
||||
result['name'] = res.partner_ref
|
||||
|
||||
domain = {}
|
||||
result['uos_id'] = uom or res.uom_id.id or False
|
||||
result['uos_id'] = res.uom_id.id or uom or False
|
||||
if result['uos_id']:
|
||||
res2 = res.uom_id.category_id.id
|
||||
if res2 :
|
||||
@@ -1323,8 +1323,22 @@ class account_invoice_line(osv.osv):
|
||||
if company.currency_id.id != currency.id:
|
||||
new_price = res_final['value']['price_unit'] * currency.rate
|
||||
res_final['value']['price_unit'] = new_price
|
||||
|
||||
if uom:
|
||||
uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
|
||||
if res.uom_id.category_id.id == uom.category_id.id:
|
||||
new_price = res_final['value']['price_unit'] * uom.factor_inv
|
||||
res_final['value']['price_unit'] = new_price
|
||||
return res_final
|
||||
|
||||
def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
|
||||
res = self.product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
|
||||
if 'uos_id' in res['value']:
|
||||
del res['value']['uos_id']
|
||||
if not uom:
|
||||
res['value']['price_unit'] = 0.0
|
||||
return res
|
||||
|
||||
def move_line_get(self, cr, uid, invoice_id, context=None):
|
||||
res = []
|
||||
tax_grouped = {}
|
||||
|
||||
@@ -83,7 +83,10 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="hr_timesheet_line_search"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
|
||||
<menuitem id="menu_hr_working_hours" parent="hr_attendance.menu_hr_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
|
||||
|
||||
<record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
|
||||
<field name="name">hr.timesheet.employee.extd_form</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
||||
Reference in New Issue
Block a user