[MERGE] Merge Team3 Branch for the changes:
[FIX] Account: creating invoice with invoice sequence fieled on journal fix the error on action number, Add the warning if user try to create invoice without defining invoice sequence field on jounrnal, valdating moves did not create analytic entries and small change in view [IMP] hr_payroll: view improved bzr revid: mra@mra-laptop-20100702070702-a4dggmabe59lys7c
This commit is contained in:
@@ -1199,6 +1199,7 @@ class account_move(osv.osv):
|
||||
#
|
||||
# Validate a balanced move. If it is a centralised journal, create a move.
|
||||
#
|
||||
|
||||
def validate(self, cr, uid, ids, context={}):
|
||||
if context and ('__last_update' in context):
|
||||
del context['__last_update']
|
||||
@@ -1283,11 +1284,11 @@ class account_move(osv.osv):
|
||||
'state': 'draft'
|
||||
}, context, check=False)
|
||||
ok = False
|
||||
if ok:
|
||||
list_ids = []
|
||||
for tmp in move.line_id:
|
||||
list_ids.append(tmp.id)
|
||||
self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context)
|
||||
if ok:
|
||||
list_ids = []
|
||||
for tmp in move.line_id:
|
||||
list_ids.append(tmp.id)
|
||||
self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context)
|
||||
return ok
|
||||
account_move()
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="terp-camera_test"/>
|
||||
<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="terp-gtk-stop"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="stock_effects-object-colorize"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
<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="terp-dolar"/>
|
||||
</group>
|
||||
|
||||
@@ -767,6 +767,8 @@ class account_invoice(osv.osv):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
context = {}
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if not inv.journal_id.invoice_sequence_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please define invoice sequence on invoice journal'))
|
||||
if not inv.invoice_line:
|
||||
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
|
||||
if inv.move_id:
|
||||
@@ -790,7 +792,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
# one move line per tax line
|
||||
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
||||
|
||||
|
||||
entry_type=''
|
||||
if inv.type in ('in_invoice', 'in_refund'):
|
||||
ref = inv.reference
|
||||
@@ -922,7 +924,7 @@ class account_invoice(osv.osv):
|
||||
if not number:
|
||||
if obj_inv.journal_id.invoice_sequence_id:
|
||||
sid = obj_inv.journal_id.invoice_sequence_id.id
|
||||
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id=%s', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
|
||||
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
|
||||
else:
|
||||
number = self.pool.get('ir.sequence').get(cr, uid,
|
||||
'account.invoice.' + invtype)
|
||||
@@ -1028,7 +1030,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def refund(self, cr, uid, ids, date=None, period_id=None, description=None):
|
||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
|
||||
|
||||
|
||||
new_ids = []
|
||||
for invoice in invoices:
|
||||
del invoice['id']
|
||||
|
||||
@@ -486,23 +486,8 @@
|
||||
</group>
|
||||
</page>
|
||||
<page string="Accounting Details">
|
||||
<group col="2" colspan="3">
|
||||
<separator colspan="4" string="Accounting Informations"/>
|
||||
<field name="move_ids" colspan="2" nolabel="1" readonly="1">
|
||||
<tree string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</tree>
|
||||
<form string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<separator colspan="4" string="Other Informations"/>
|
||||
<separator colspan="2" string="Other Informations"/>
|
||||
<field name="paid" readonly="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="register_id"/>
|
||||
@@ -512,12 +497,6 @@
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Account Lines">
|
||||
<field name="move_line_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Payment Lines">
|
||||
<field name="move_payment_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="10" colspan="4">
|
||||
<field name="state"/>
|
||||
|
||||
Reference in New Issue
Block a user