[IMP]account_check_deposit: customization webkit

This commit is contained in:
Delli Chafique
2013-02-21 14:11:40 +01:00
committed by Sebastien Beau
parent f705a6b026
commit 2113099784
3 changed files with 34 additions and 15 deletions

View File

@@ -33,9 +33,9 @@
You may have to create an account for recieved checks and a journal for payment by checks.""",
'author': 'Akretion',
'website': 'http://www.akretion.com/',
'depends': ['account_accountant','report_webkit'],
'depends': ['account_accountant','report_webkit','sale_quick_payment'],
'init_xml': [],
'update_xml': [
'update_xml': [
'account_deposit_view.xml',
'account_deposit_sequence.xml',
'account_type_data.xml',
@@ -44,4 +44,3 @@
'installable': True,
'active': False,
}

View File

@@ -53,6 +53,11 @@ class account_check_deposit(Model):
],'Status', readonly=True),
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True,
states={'draft':[('readonly',False)]}),
'bank_id': fields.many2one('res.partner.bank', 'Bank', required=True, readonly=True,
domain="[('partner_id', '=', partner_id)]",
states={'draft':[('readonly',False)]}),
'partner_id':fields.related('company_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", readonly=True),
'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),
'total_amount': fields.function(sum_amount, string ="total amount"),
}
@@ -60,6 +65,7 @@ class account_check_deposit(Model):
'name': lambda self, cr, uid, context: '/',
'deposit_date': fields.date.context_today,
'state':'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.check.deposit', context=c),
}
@@ -133,6 +139,17 @@ class account_check_deposit(Model):
move_line_obj.reconcile(cr, uid, [line.id, move_line_ids[0]], context=context)
return True
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
vals={}
if company_id:
company=self.pool.get('res.company').browse(cr, uid, company_id, context=context)
vals['partner_id']=company.partner_id.id
return {'value':vals}
def validate_deposit(self, cr, uid, ids, context=None):
move_obj = self.pool.get('account.move')
if context is None:

View File

@@ -15,8 +15,8 @@
model="account.check.deposit"
name="check.deposit.webkit"
report_type="webkit"
string="WebKit Check Deposit"/>
string="WebKit Checks Deposit"/>
<!-- INHERITED VIEW FOR THE OBJECT : account_check_deposit -->
<record id="account_check_deposit_view_form" model="ir.ui.view">
@@ -24,7 +24,7 @@
<field name="model">account.check.deposit</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Check Deposit" version="7.0">
<form string="Checks Deposit" version="7.0">
<header>
<button name="validate_deposit" states="draft" string="Validate Deposit"
type="object" class="oe_highlight"/>
@@ -34,19 +34,22 @@
</header>
<sheet>
<h1>
<label string="Deposit " />
<label string="Deposit " />
<field name="name" class="oe_inline" />
</h1>
<group name="deposit_fields">
<field name="deposit_date" />
<field name="journal_id" />
<field name="move_id" />
<field name="company_id" on_change="onchange_company_id(company_id, context)"/>
<field name="partner_id" invisible="1"/>
<field name="bank_id"/>
</group>
<separator string="Check Payments"/>
<field name="check_payment_ids" nolabel="1" colspan="4" widget="many2many"
domain="[('reconcile_id','=',False),
('account_id.user_type.code','=','recieved_check')]">
<tree string="Check Payments">
<tree string="Check Payment">
<field name="journal_id" />
<field name="period_id" />
<field name="date"/>
@@ -70,7 +73,7 @@
<field name="model">account.check.deposit</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Check Deposit">
<tree string="Checks Deposit">
<field name="name"/>
<field name="deposit_date"/>
<field name="state"/>
@@ -78,13 +81,13 @@
</tree>
</field>
</record>
<record id="view_check_deposit_search" model="ir.ui.view">
<field name="name">account.check.deposit.search</field>
<field name="model">account.check.deposit</field>
<field name="arch" type="xml">
<search string="Search Check deposits">
<field name="name" string="Check Deposit"/>
<search string="Checks Deposit Search">
<field name="name" string="Checks Deposit"/>
<field name="deposit_date" string="Date"/>
<field name="state"/>
<field name="move_id"/>
@@ -93,9 +96,9 @@
</search>
</field>
</record>
<record id="action_check_deposit_tree" model="ir.actions.act_window">
<field name="name">Check Deposits</field>
<field name="name">Checks Deposit</field>
<field name="res_model">account.check.deposit</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
@@ -105,7 +108,7 @@
<field name="help" type="html"></field>
</record>
<menuitem string="Check Deposit" action="action_check_deposit_tree" id="menu_check_deposit_tree" parent="account.menu_finance_bank_and_cash" sequence="20"/>
<menuitem string="Checks Deposit" action="action_check_deposit_tree" id="menu_check_deposit_tree" parent="account.menu_finance_bank_and_cash" sequence="20"/>
</data>
</openerp>