[FIX] account: prevent selecting company's contacts for manual account.move.line

Only the commercial partner (parent company) should be set in partner field of
an account.move.line.
Fixes #4261, opw 618763
This commit is contained in:
Somesh Khare 2014-12-17 11:25:58 +05:30 committed by Martin Trigaux
parent 36af222569
commit ba70393bc4
1 changed files with 15 additions and 5 deletions

View File

@ -995,7 +995,9 @@
<group>
<field name="name"/>
<field name="ref"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
</group>
<group>
<field name="journal_id"/>
@ -1068,7 +1070,9 @@
<field name="journal_id" readonly="False"/>
<field name="period_id" readonly="False"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation'),('company_id', '=', company_id)]"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<newline/>
<field name="debit"/>
<field name="credit"/>
@ -1112,7 +1116,9 @@
<field name="name"/>
<field name="ref"/>
<field name="statement_id" invisible="1"/>
<field name="partner_id" on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"/>
<field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]" on_change="onchange_account_id(account_id, partner_id, context)"/>
<field name="account_tax_id" options='{"no_open":True}' invisible="context.get('journal_type', False) not in ['sale','sale_refund','purchase','purchase_refund','general']"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type','not in',['view','template'])]" invisible="not context.get('analytic_journal_id',False)"/>
@ -1289,7 +1295,9 @@
<group col="6" colspan="4">
<field name="name"/>
<field name="ref"/>
<field name="partner_id" on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, date, journal_id, context)"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, date, journal_id, context)"/>
<field name="journal_id"/>
<field name="period_id"/>
@ -1353,7 +1361,9 @@
<tree colors="blue:state == 'draft';black:state == 'posted'" editable="top" string="Journal Items">
<field name="invoice"/>
<field name="name"/>
<field name="partner_id" on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, parent.date, parent.journal_id, context)"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
on_change="onchange_partner_id(False, partner_id, account_id, debit, credit, parent.date, parent.journal_id, context)"/>
<field name="account_id" domain="[('journal_id','=',parent.journal_id),('company_id', '=', parent.company_id)]"/>
<field name="date_maturity"/>
<field name="debit" sum="Total Debit"/>