obj_journal.create(cr,uid,vals_journal)
# Bank Journals
- view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Cash Journal View')])[0]
- view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Multi-Currency Cash Journal View')])[0]
- data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
- data = data_pool.browse(cr, uid, data_id[0])
- view_id_cash = data.res_id
- #view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name
-
- data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')])
- data = data_pool.browse(cr, uid, data_id[0])
- ref_acc_bank = data.res_id
- #ref_acc_bank = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name
++ view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name
++ view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name
ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id
current_num = 1
</group>
<notebook colspan="4">
<page string="General Information">
+ <group col="2" colspan="2">
+ <group colspan="2" col="2">
+ <separator string="Accounts" colspan="4"/>
+ <field name="default_debit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ <field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ </group>
+ <group colspan="2" col="2">
+ <separator string="Journal View" colspan="4"/>
+ <field name="view_id" widget="selection"/>
+ </group>
+ </group>
+
<group colspan="2" col="2">
- <separator string="Journal View" colspan="4"/>
- <field name="view_id" widget="selection"/>
+ <separator string="Company" colspan="4"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ <field name="user_id" groups="base.group_extended"/>
+ <field name="currency"/>
</group>
-
<group colspan="2" col="2">
- <separator string="Sequence" colspan="4"/>
- <field name="sequence_id"/>
+ <separator string="Validations" colspan="4"/>
+ <field name="allow_date" groups="base.group_extended"/>
</group>
+
<group colspan="2" col="2">
- <separator string="Accounts" colspan="4"/>
- <field name="default_debit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
- <field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ <separator string="Other Configuration" colspan="4"/>
+ <field name="centralisation" groups="base.group_extended"/>
+ <field name="entry_posted"/>
++ <field name="update_posted"/>
</group>
-
++
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
- <field name="invoice_sequence_id"/>
+ <field name="invoice_sequence_id" groups="base.group_extended"/>
<field name="group_invoice_lines"/>
</group>
-
- <group colspan="2" col="2">
- <separator string="Company" colspan="4"/>
- <field name="company_id" groups="base.group_multi_company"/>
- <field name="user_id" groups="base.group_extended"/>
- <field name="currency"/>
- </group>
- <group col="2" colspan="2">
- <group colspan="2" col="2">
- <separator string="Validations" colspan="4"/>
- <field name="allow_date" groups="base.group_extended"/>
- </group>
-
- <group colspan="2" col="2">
- <separator string="Other Configuration" colspan="4"/>
- <field name="centralisation" groups="base.group_extended"/>
- <field name="entry_posted"/>
- <!-- <field name="update_posted"/> -->
- </group>
+ <group colspan="2" col="2" groups="base.group_extended">
+ <separator string="Sequence" colspan="4"/>
+ <field name="sequence_id"/>
</group>
</page>
<page string="Entry Controls" groups="base.group_extended">
},
help="Remaining amount due."),
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
- 'move_name': fields.char('Ledger Posting', size=64),
- 'user_id': fields.many2one('res.users', 'Salesman'),
+ 'move_name': fields.char('Ledger Posting', size=64, readonly=True, states={'draft':[('readonly',False)]}),
+ 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
- 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]})
+ 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
}
_defaults = {
'type': _get_type,
<field name="partner_bank" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="nbr" sum="# of Lines"/>
- <field name="product_qty" sum="Qty"/>
+ <field name="product_qty"/>
<field name="reconciled" sum="# Reconciled"/>
- <field name="price_average" sum="Average Price"/>
+ <field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
- <field name="residual" sum="Total Residual"/>
- <field name="delay_to_pay" avg="Avg. Delay To Pay"/>
- <field name="residual" sum="Total Residual" invisible="context.get('residual_invisible',False)"/>
- <field name="delay_to_pay" sum="Avg. Delay To Pay" invisible="context.get('residual_invisible',False)"/>
++ <field name="residual" sum="Total Residual" invisible="not context.get('residual_visible',False)"/>
++ <field name="delay_to_pay" avg="Avg. Delay To Pay" invisible="not context.get('residual_visible',False)"/>
</tree>
</field>
</record>
</group>
<newline/>
<group expand="1" string="Group By...">
-- <filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/>
- <filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
++ <filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id','residual_visible':True}"/>
+ <filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id','residual_visible':True}"/>
- <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True,'residual_invisible':True}"/>
+ <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True}"/>
<separator orientation="vertical"/>
-- <filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
-- <filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
++ <filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state','residual_visible':True}"/>
++ <filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'type','residual_visible':True}"/>
<separator orientation="vertical"/>
-- <filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
-- <filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
++ <filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id','residual_visible':True}"/>
++ <filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id','residual_visible':True}"/>
<separator orientation="vertical"/>
- <filter string="Category of Product" icon="terp-stock_symbol-selection" context="{'group_by':'categ_id','residual_invisible':True}"/>
- <filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
+ <filter string="Category of Product" icon="terp-stock_symbol-selection" context="{'group_by':'categ_id'}"/>
- <filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
++ <filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id','residual_visible':True}"/>
<separator orientation="vertical"/>
-- <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
++ <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id','residual_visible':True}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
-- <filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}"/>
-- <filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}"/>
-- <filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}"/>
++ <filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day','residual_visible':True}"/>
++ <filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month','residual_visible':True}"/>
++ <filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year','residual_visible':True}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
residual = currency_pool.compute(cr, uid, invoice.currency_id.id, currency_id, invoice.residual)
res.update({
- 'amount': residual
+ 'amount': residual,
- 'account_id': invoice.account_id.id,
- 'ref':invoice.number
++ 'account_id': invoice.account_id.id
})
return {