[IMP] account: change position of button and their icons
bzr revid: psi@tinyerp.co.in-20100517123426-9a8y90tgxktlm9tm
This commit is contained in:
parent
291dab8423
commit
bee95259e7
|
@ -146,7 +146,7 @@
|
|||
<field name="number" readonly="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
|
||||
<button name="%(action_account_change_currency)d" type="action" icon="gtk-apply" string="Change Currency" />
|
||||
<button name="%(action_account_change_currency)d" type="action" icon="gtk-apply" string="Change Currency"/>
|
||||
<newline/>
|
||||
<field name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" context="{'default_customer': 0}"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
|
||||
|
@ -202,11 +202,11 @@
|
|||
<field name="residual"/>
|
||||
<group col="3" colspan="4">
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-apply"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="gtk-ok"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="gtk-convert"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Credit Note' states='paid' icon="gtk-convert"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Credit Note' states='paid' icon="gtk-execute"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
@ -296,11 +296,11 @@
|
|||
<group col="4" colspan="4" groups="base.group_user">
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="gtk-print"/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Create" icon="gtk-execute"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="gtk-convert"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="gtk-ok"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Credit Note' states='paid' icon="gtk-convert"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Credit Note' states='paid' icon="gtk-execute"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
|
|
@ -48,27 +48,26 @@ class account_change_currency(osv.osv_memory):
|
|||
data = self.read(cr, uid, ids)[0]
|
||||
new_currency = data['currency_id']
|
||||
|
||||
for invoice in obj_inv.browse(cr, uid, context['active_ids'], context=context):
|
||||
if invoice.currency_id.id == new_currency:
|
||||
continue
|
||||
invoice = obj_inv.browse(cr, uid, context['active_id'], context=context)
|
||||
if invoice.currency_id.id == new_currency:
|
||||
return {}
|
||||
|
||||
for line in invoice.invoice_line:
|
||||
rate = obj_currency.browse(cr, uid, new_currency).rate
|
||||
new_price = 0
|
||||
if invoice.company_id.currency_id.id == invoice.currency_id.id:
|
||||
new_price = line.price_unit * rate
|
||||
for line in invoice.invoice_line:
|
||||
rate = obj_currency.browse(cr, uid, new_currency).rate
|
||||
new_price = 0
|
||||
if invoice.company_id.currency_id.id == invoice.currency_id.id:
|
||||
new_price = line.price_unit * rate
|
||||
|
||||
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
|
||||
old_rate = invoice.currency_id.rate
|
||||
new_price = line.price_unit / old_rate
|
||||
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
|
||||
old_rate = invoice.currency_id.rate
|
||||
new_price = line.price_unit / old_rate
|
||||
|
||||
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
|
||||
old_rate = invoice.currency_id.rate
|
||||
new_price = (line.price_unit / old_rate ) * rate
|
||||
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
|
||||
old_rate = invoice.currency_id.rate
|
||||
new_price = (line.price_unit / old_rate ) * rate
|
||||
|
||||
obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
|
||||
invoice_ids.append(invoice.id)
|
||||
obj_inv.write(cr, uid, invoice_ids, {'currency_id' : new_currency}, context=context)
|
||||
obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
|
||||
obj_inv.write(cr, uid, invoice.id, {'currency_id' : new_currency}, context=context)
|
||||
return {}
|
||||
|
||||
account_change_currency()
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Invoice Currency">
|
||||
<separator colspan="4" string="This wizard will change the currency of the invoice"/>
|
||||
<field name="currency_id"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="2" col="4">
|
||||
|
|
|
@ -46,6 +46,7 @@ class account_invoice_refund(osv.osv_memory):
|
|||
account_m_line_obj = self.pool.get('account.move.line')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -111,7 +112,6 @@ class account_invoice_refund(osv.osv_memory):
|
|||
to_reconcile_ids[line.account_id.id] = [line.id]
|
||||
if type(line.reconcile_id) != osv.orm.browse_null :
|
||||
reconcile_obj.unlink(cr, uid, line.reconcile_id.id)
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'account.invoice', \
|
||||
refund.id, 'invoice_open', cr)
|
||||
refund = inv_obj.browse(cr, uid, refund_id[0],context=context)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Credit Note">
|
||||
<separator string="This wizard is used to refund the invoice" colspan="4"/>
|
||||
<group colspan="4" >
|
||||
<label string="Are you sure you want to refund this invoice ?" colspan="2"/>
|
||||
<newline/>
|
||||
|
@ -15,7 +16,7 @@
|
|||
<field name="period"/>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
|
|
Loading…
Reference in New Issue