[IMP] Account: Misc improvement and cleaning
bzr revid: mra@tinyerp.com-20100406072756-fp68vs82rizjri2d
This commit is contained in:
parent
34a6157058
commit
5ee2d53302
|
@ -21,7 +21,6 @@
|
|||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_chart(osv.osv_memory):
|
||||
"""
|
||||
|
|
|
@ -18,13 +18,10 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
import netsvc
|
||||
|
||||
|
||||
class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
"""Refunds invoice."""
|
||||
|
|
|
@ -18,11 +18,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
|
||||
class account_move_line_reconcile_select(osv.osv_memory):
|
||||
_name = "account.move.line.reconcile.select"
|
||||
|
@ -41,17 +38,16 @@ class account_move_line_reconcile_select(osv.osv_memory):
|
|||
@return: dictionary of Open account move line window for reconcile on given account id
|
||||
|
||||
"""
|
||||
for data in self.read(cr, uid, ids,context=context):
|
||||
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': _('Reconciliation'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
data = self.read(cr, uid, ids, context=context)[0]
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': _('Reconciliation'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
account_move_line_reconcile_select()
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-open"
|
||||
string="Open for reconciliation" name="action_open_window"
|
||||
string="Open for Reconciliation" name="action_open_window"
|
||||
type="object" />
|
||||
</group>
|
||||
</form>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_account_reconcile_select" model="ir.actions.act_window">
|
||||
<field name="name">Reconcile entries</field>
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="res_model">account.move.line.reconcile.select</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -30,20 +30,19 @@ class account_move_line_unreconcile_select(osv.osv_memory):
|
|||
_description = "Unreconciliation"
|
||||
_columns ={
|
||||
'account_id': fields.many2one('account.account','Account',required=True),
|
||||
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
for data in self.read(cr, uid, ids):
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': 'Unreconciliation',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
data = self.read(cr, uid, ids, context=context)[0]
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': 'Unreconciliation',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
account_move_line_unreconcile_select()
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-open"
|
||||
string="Open for Unreconciliation" name="action_open_window"
|
||||
string="Open For Unreconciliation" name="action_open_window"
|
||||
type="object" />
|
||||
</group>
|
||||
</form>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</record>
|
||||
|
||||
<record id="action_account_unreconcile_select" model="ir.actions.act_window">
|
||||
<field name="name">Unreconcile entries</field>
|
||||
<field name="name">Unreconcile Entries</field>
|
||||
<field name="res_model">account.move.line.unreconcile.select</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_period_close(osv.osv_memory):
|
||||
"""
|
||||
|
@ -30,7 +29,7 @@ class account_period_close(osv.osv_memory):
|
|||
_name = "account.period.close"
|
||||
_description = "period close"
|
||||
_columns = {
|
||||
'sure': fields.boolean('Check this box', required=False),
|
||||
'sure': fields.boolean('Check this box'),
|
||||
}
|
||||
|
||||
def data_save(self, cr, uid, ids, context={}):
|
||||
|
@ -47,8 +46,8 @@ class account_period_close(osv.osv_memory):
|
|||
for id in context['active_ids']:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
return {}
|
||||
return {}
|
||||
|
||||
account_period_close()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Loading…
Reference in New Issue