bzr revid: fp@tinyerp.com-20080829112832-e08mka7zh54wixif
This commit is contained in:
Fabien Pinckaers 2008-08-29 13:28:32 +02:00
parent a961da825b
commit e4a6a913da
5 changed files with 742 additions and 753 deletions

View File

@ -927,14 +927,15 @@ class account_move_reconcile(osv.osv):
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/', 'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
} }
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}): def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
for rec in self.pool.get('account.move.reconcile').browse(cr, uid, ids): for rec in self.browse(cr, uid, ids, context):
total = 0.0 total = 0.0
for line in rec.line_partial_ids: for line in rec.line_partial_ids:
total += (line.debit or 0.0) - (line.credit or 0.0) total += (line.debit or 0.0) - (line.credit or 0.0)
if not total: if not total:
self.write(cr,uid, map(lambda x: x.id, rec.line_partial_ids), {'reconcile_id': rec.id }) self.pool.get('account.move.line').write(cr, uid,
for line in rec.line_partial_ids: map(lambda x: x.id, rec.line_partial_ids),
total += (line.debit or 0.0) - (line.credit or 0.0) {'reconcile_id': rec.id }
)
return True return True
def name_get(self, cr, uid, ids, context=None): def name_get(self, cr, uid, ids, context=None):
result = {} result = {}

View File

@ -378,7 +378,8 @@ class account_move_line(osv.osv):
unmerge.append(line.id) unmerge.append(line.id)
total += (line.debit or 0.0) - (line.credit or 0.0) total += (line.debit or 0.0) - (line.credit or 0.0)
if not total: if not total:
return self.reconcile(cr, uid, merges+unmerge, context=context) res = self.reconcile(cr, uid, merges+unmerge, context=context)
return res
r_id = self.pool.get('account.move.reconcile').create(cr, uid, { r_id = self.pool.get('account.move.reconcile').create(cr, uid, {
'type': type, 'type': type,
'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge) 'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge)
@ -578,14 +579,12 @@ class account_move_line(osv.osv):
if not context: if not context:
context={} context={}
raise_ex=False raise_ex=False
account_obj = self.pool.get('account.account')
acc=account_obj.browse(cr,uid,ids)[0]
if ('debit' in vals and 'credit' in vals) and not vals['debit'] and not vals['credit']: if ('debit' in vals and 'credit' in vals) and not vals['debit'] and not vals['credit']:
raise_ex=True raise_ex=True
if ('debit' in vals and 'credit' not in vals) and not vals['debit'] and not acc.credit: if ('debit' in vals and 'credit' not in vals) and not vals['debit']:
raise_ex=True raise_ex=True
if ('credit' in vals and 'debit' not in vals) and not vals['credit'] and not acc.debit: if ('credit' in vals and 'debit' not in vals) and not vals['credit']:
raise_ex=True raise_ex=True
if raise_ex: if raise_ex:

View File

@ -2,7 +2,7 @@
<terp> <terp>
<data> <data>
<record id="noone" model="res.groups"> <record id="noone" model="res.groups">
<field name="name">No One</field> <field name="name">No One Association</field>
</record> </record>
<record id="hr.menu_hr_root" model="ir.ui.menu"> <record id="hr.menu_hr_root" model="ir.ui.menu">
<field eval="[(6,0,[ref('noone')])]" name="groups_id"/> <field eval="[(6,0,[ref('noone')])]" name="groups_id"/>

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<notebook position="inside"> <notebook position="inside">
<page string="Payments"> <page string="Payments">
<field name="move_lines" colspan="4"/> <field name="move_lines" colspan="4" nolabel="1"/>
</page> </page>
</notebook> </notebook>
</field> </field>