bzr revid: fp@tinyerp.com-20090126181051-7qnobhuclh0dfyus
This commit is contained in:
Fabien Pinckaers 2009-01-26 19:10:51 +01:00
parent 771c240a42
commit 31fc6a5973
3 changed files with 21 additions and 20 deletions

View File

@ -219,7 +219,7 @@ def _reconcile(self, cr, uid, data, context):
power = form['power']
reconciled = unreconciled = 0
if not form['account_ids'][0][2]:
form['account_ids'][0][2] = pooler.get_pool(cr.dbname).get('account.account').search(cr, uid, [('reconcile','=',True)])
raise wizard.except_wizard(_('UserError'), _('You must select accounts to reconcile'))
for account_id in form['account_ids'][0][2]:
# reconcile automatically all transactions from partners whose balance is 0
@ -231,7 +231,7 @@ def _reconcile(self, cr, uid, data, context):
"AND state <> 'draft' " \
"GROUP BY partner_id " \
"HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0",
(account_id, max_amount))
(account_id, max_amount or 0.0))
partner_ids = [id for (id,) in cr.fetchall()]
for partner_id in partner_ids:

View File

@ -274,14 +274,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Cases">
<field colspan="4" name="name" select="1"/>
<field colspan="3" name="section_id"/>
<field name="date" select="1"/>
<field name="date_deadline" select="2"/>
<field colspan="3" name="priority"/>
<notebook>
<page string="General">
<group col="8" colspan="4">
<field colspan="4" name="name" select="1"/>
<field colspan="3" name="section_id"/>
<field name="date" select="1"/>
<field name="date_deadline" select="2"/>
<field colspan="3" name="priority"/>
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" select="1"/>
<field colspan="3" name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" select="2"/>
<newline/>

View File

@ -48,22 +48,23 @@ section_fields = {
}
menu_lst = [
(1,'My ',"[('section_id','=',SECTION_ID),('user_id','=',uid)]", 0, 'form,tree'),
(2,'My Unclosed ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','<>','cancel'), ('state','<>','done')]", 1, 'tree,form'),
(5,'My Open ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','open')]", 2, 'tree,form'),
(6,'My Pending ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','pending')]", 2, 'tree,form'),
(7,'My Draft ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','draft')]", 2, 'tree,form'),
(3,'My Late ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('date_deadline','<=',time.strftime('%Y-%m-%d')), ('state','<>','cancel'), ('state','<>','done')]", 1, 'tree,form'),
(1,'My ',"[('section_id','=',SECTION_ID),('user_id','=',uid)]", 0, 'tree,form,calendar'),
(2,'My Unclosed ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','<>','cancel'), ('state','<>','done')]", 1, 'tree,form,calendar'),
(5,'My Open ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','open')]", 2, 'tree,form,calendar'),
(6,'My Pending ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','pending')]", 2, 'tree,form,calendar'),
(7,'My Draft ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','draft')]", 2, 'tree,form,calendar'),
(3,'My Late ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('date_deadline','<=',time.strftime('%Y-%m-%d')), ('state','<>','cancel'), ('state','<>','done')]", 1, 'tree,form,calendar'),
(4,'My Canceled ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('state','=','cancel')]", 1, 'no'),
(8,'All ',"[('section_id','=',SECTION_ID),]", 0, 'tree,form'),
(8,'All ',"[('section_id','=',SECTION_ID),]", 0, 'tree,form,calendar'),
(9,'All Unassigned ',"[('section_id','=',SECTION_ID),('user_id','=',False)]", 8, 'no'),
(10,'All Late ',"[('section_id','=',SECTION_ID),('user_id','=',uid), ('date_deadline','<=',time.strftime('%Y-%m-%d')), ('state','<>','cancel'), ('state','<>','done')]", 8, 'no'),
(11,'All Canceled ',"[('section_id','=',SECTION_ID),('state','=','cancel')]", 8, 'no'),
(12,'All Unclosed ',"[('section_id','=',SECTION_ID),('state','<>','cancel'), ('state','<>','done')]", 8, 'tree,form'),
(13,'All Open ',"[('section_id','=',SECTION_ID),('state','=','open')]", 12, 'tree,form'),
(14,'All Pending ',"[('section_id','=',SECTION_ID),('state','=','pending')]", 12, 'tree,form'),
(15,'All Draft ',"[('section_id','=',SECTION_ID),('state','=','draft')]", 12, 'tree,form'),
(16,'All Unclosed and Unassigned ',"[('section_id','=',SECTION_ID),('user_id','=',False),('state','<>','cancel'),('state','<>','done')]", 12, 'no')
(12,'All Unclosed ',"[('section_id','=',SECTION_ID),('state','<>','cancel'), ('state','<>','done')]", 8, 'tree,form,calendar'),
(13,'All Open ',"[('section_id','=',SECTION_ID),('state','=','open')]", 12, 'tree,form,calendar'),
(14,'All Pending ',"[('section_id','=',SECTION_ID),('state','=','pending')]", 12, 'tree,form,calendar'),
(15,'All Draft ',"[('section_id','=',SECTION_ID),('state','=','draft')]", 12, 'tree,form,calendar'),
(16,'All Unclosed and Unassigned ',"[('section_id','=',SECTION_ID),('user_id','=',False),('state','<>','cancel'),('state','<>','done')]", 12, 'no'),
(17,'New ',"[('section_id','=',SECTION_ID)]", 0, 'form,tree,calendar'),
]
section_menu_form = '''<?xml version="1.0"?>
@ -86,7 +87,7 @@ for menu in menu_lst:
('no',"Don't Create"),
('form,tree','New Form'),
('form,tree,calendar','New With Calendar'),
('tree,form','List'),
('tree,form,calendar','List'),
('tree,form,calendar','List With Calendar'),
('calendar,tree,form','Calendar'),
],