[MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 9129 dle@openerp.com-20140213115951-h7c2o65lgg26aosv

bzr revid: chs@openerp.com-20140212182315-clifgy95ug2rd6d8
bzr revid: dle@openerp.com-20140213120325-zq9bnl035i1s6xd4
This commit is contained in:
Denis Ledoux 2014-02-13 13:03:25 +01:00
commit c24633928f
3 changed files with 16 additions and 16 deletions

View File

@ -911,9 +911,10 @@ class account_voucher(osv.osv):
if context.get('payment_expected_currency') and currency_id != context.get('payment_expected_currency'):
vals['value']['amount'] = 0
amount = 0
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context)
for key in res.keys():
vals[key].update(res[key])
if partner_id:
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context)
for key in res.keys():
vals[key].update(res[key])
return vals
def button_proforma_voucher(self, cr, uid, ids, context=None):
@ -965,7 +966,7 @@ class account_voucher(osv.osv):
res = {}
if not partner_id:
return res
res = {'account_id':False}
res = {}
partner_pool = self.pool.get('res.partner')
journal_pool = self.pool.get('account.journal')
if pay_now == 'pay_later':
@ -977,7 +978,8 @@ class account_voucher(osv.osv):
account_id = partner.property_account_payable.id
else:
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
res['account_id'] = account_id
if account_id:
res['account_id'] = account_id
return {'value':res}
def _sel_context(self, cr, uid, voucher_id, context=None):

View File

@ -73,8 +73,14 @@
<group>
<group>
<field name="type" invisible="True"/>
<field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
<field name="account_id"
domain="[('type','in', ['liquidity', 'receivable'])]"/>
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
</group>
<group>
<field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)" groups="account.group_account_user"/>
@ -112,15 +118,6 @@
</div>
<field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
</group>
<group>
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
<field name="account_id"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
domain="[('type','=','liquidity')]"/>
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
</group>
</group>
</page>
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
@ -224,11 +221,11 @@
<h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
<field name="pay_now" invisible="1"/>
<field name="account_id" domain="[('type','=','other')]" invisible="True"/>
<field name="type" invisible="True"/>
<group>
<group>
<field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
<field name="account_id" domain="[('type', 'in', ['liquidity', 'payable'])]"/>
<field name="name" colspan="2"/>
<field name="reference"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>

View File

@ -14,6 +14,7 @@ openerp.pad = function(instance) {
this.$('.oe_pad_switch').click(function() {
self.$el.toggleClass('oe_pad_fullscreen');
self.$el.find('.oe_pad_switch').toggleClass('fa-expand fa-compress');
self.view.$el.find('.oe_chatter').toggle();
});
this.render_value();
},