Merge lp:~mileo/account-payment/7.0 into lp:~account-payment-team/account-payment/7.0

Status: Merged
Merged at revision: 95
Proposed branch: lp:~mileo/account-payment/7.0
Merge into: lp:~account-payment-team/account-payment/7.0
Diff against target: 204 lines (+54/-48)
2 files modified
account_payment_extension/account_move_line.py (+23/-16)
account_payment_extension/payment_view.xml (+31/-32)
To merge this branch: bzr merge lp:~mileo/account-payment/7.0
Reviewer Review Type Date Requested Status
Raphaël Valyi - http://www.akretion.com Pending
Review via email: mp+141652@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_payment_extension/account_move_line.py' (properties changed: -x to +x)
--- account_payment_extension/account_move_line.py 2012-11-01 21:49:33 +0000
+++ account_payment_extension/account_move_line.py 2013-01-02 17:55:31 +0000
@@ -170,22 +170,29 @@
170 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check)170 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check)
171 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check=False)171 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check=False)
172172
173 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):173
174 menus = [174#the search filter view system changed in v7: you can now search by any field and there is no more select in widget, so further work would be
175 self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_invoice_payments'),175# required to port the following logic to v7.
176 self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_done_payments'),176#
177 ]177# In the meantime, as the feature loss isn't that huge and as workarounds are possible we simply commented the following code out.
178 menus = [m[1] for m in menus]178
179 if 'active_id' in context and context['active_id'] in menus:179# def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
180 # Use standard views for account.move.line object180# menus = [
181 if view_type == 'search':181# self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_invoice_payments'),
182 # Get a specific search view (bug in 6.0RC1, it does not give the search view defined in the action window)182# self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_done_payments'),
183 view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1]183# ]
184 result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)184#
185 else:185# menus = [m[1] for m in menus]
186 # Use special views for account.move.line object (for ex. tree view contains user defined fields)186# if 1==1: # 'active_id' in context and context['active_id'] in menus:
187 result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)187# # Use standard views for account.move.line object
188 return result188# if view_type == 'search':
189# # Get a specific search view (bug in 6.0RC1, it does not give the search view defined in the action window)
190# view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1]
191# result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
192# else:
193# # Use special views for account.move.line object (for ex. tree view contains user defined fields)
194# result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
195# return result
189196
190account_move_line()197account_move_line()
191198
192199
=== modified file 'account_payment_extension/payment_view.xml'
--- account_payment_extension/payment_view.xml 2012-12-28 15:15:12 +0000
+++ account_payment_extension/payment_view.xml 2013-01-02 17:55:31 +0000
@@ -153,6 +153,7 @@
153 =================================================================================================153 =================================================================================================
154 -->154 -->
155 <!--Field partner_bank_id in client invoices has a strange domain: domain="[('partner_id.ref_companies', 'in', [company_id])]"-->155 <!--Field partner_bank_id in client invoices has a strange domain: domain="[('partner_id.ref_companies', 'in', [company_id])]"-->
156
156 <record model="ir.ui.view" id="invoice_form3">157 <record model="ir.ui.view" id="invoice_form3">
157 <field name="name">account.invoice.form3.payment_type</field>158 <field name="name">account.invoice.form3.payment_type</field>
158 <field name="model">account.invoice</field>159 <field name="model">account.invoice</field>
@@ -163,15 +164,15 @@
163 <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>164 <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
164 </field>165 </field>
165 </field>166 </field>
166 </record>167 </record>
167168
168 <record model="ir.ui.view" id="invoice_form4">169 <record model="ir.ui.view" id="invoice_form4">
169 <field name="name">account.invoice.form4.payment_type</field>170 <field name="name">account.invoice.form4.payment_type</field>
170 <field name="model">account.invoice</field>171 <field name="model">account.invoice</field>
171 <field name="type">form</field>172 <field name="type">form</field>
172 <field name="inherit_id" ref="account.invoice_form"/>173 <field name="inherit_id" ref="account.invoice_form"/>
173 <field name="arch" type="xml">174 <field name="arch" type="xml">
174 <field name="address_invoice_id" position="after">175 <field name="fiscal_position" position="after">
175 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />176 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
176 </field>177 </field>
177 </field>178 </field>
@@ -183,15 +184,14 @@
183 <field name="type">form</field>184 <field name="type">form</field>
184 <field name="inherit_id" ref="account.invoice_supplier_form"/>185 <field name="inherit_id" ref="account.invoice_supplier_form"/>
185 <field name="arch" type="xml">186 <field name="arch" type="xml">
186 <field name="address_invoice_id" position="after">187 <field name="fiscal_position" position="after">
187 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />188 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
188 </field>189 </field>
189 </field>190 </field>
190 </record>191 </record>
191192
192193
193 <!--************ account.move.line extension to show additional fields **********-->194 <!--************ account.move.line extension to show additional fields **********-->
194 <!--
195 <record model="ir.ui.view" id="payments_move_line_tree">195 <record model="ir.ui.view" id="payments_move_line_tree">
196 <field name="name">account.payments.move.line.tree</field>196 <field name="name">account.payments.move.line.tree</field>
197 <field name="model">account.move.line</field>197 <field name="model">account.move.line</field>
@@ -214,17 +214,16 @@
214 <field name="type">form</field>214 <field name="type">form</field>
215 <field name="inherit_id" ref="account.view_move_line_form"/>215 <field name="inherit_id" ref="account.view_move_line_form"/>
216 <field name="arch" type="xml">216 <field name="arch" type="xml">
217 <separator string="Internal Note" position="before">217 <field name="narration" position="before">
218 <group col="2" colspan="2">218 <!-- <group col="2" colspan="2">
219 <separator colspan="2" string="Payment"/>219 <separator colspan="2" string="Payment"/> -->
220 <field name="payment_type" select="1" widget="selection"/>220 <field name="payment_type" select="1" widget="selection"/>
221 <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/>221 <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/>
222 <field name="received_check"/>222 <field name="received_check"/>
223 </group>223 <!-- </group> -->
224 </separator>224 </field>
225 </field>225 </field>
226 </record>226 </record>
227 -->
228227
229 <!--228 <!--
230 ========================================================================================================229 ========================================================================================================
@@ -346,7 +345,7 @@
346 =========================================================================================345 =========================================================================================
347 PAYMENTS346 PAYMENTS
348 =========================================================================================347 =========================================================================================
349 348 -->
350 <record id="view_payments_tree" model="ir.ui.view">349 <record id="view_payments_tree" model="ir.ui.view">
351 <field name="name">Payments</field>350 <field name="name">Payments</field>
352 <field name="model">account.move.line</field>351 <field name="model">account.move.line</field>
@@ -380,35 +379,33 @@
380 <field name="priority" eval="20"/>379 <field name="priority" eval="20"/>
381 <field name="arch" type="xml">380 <field name="arch" type="xml">
382 <search string="Search Invoice Payments">381 <search string="Search Invoice Payments">
383 <group col='10' colspan='4'>
384 <filter icon="terp-sale" string="Receive" domain="[('account_id.type','=','receivable')]" help="Receivable payments"/>382 <filter icon="terp-sale" string="Receive" domain="[('account_id.type','=','receivable')]" help="Receivable payments"/>
385 <filter icon="terp-purchase" string="Pay" domain="[('account_id.type','=','payable')]" help="Payable payments"/>383 <filter icon="terp-purchase" string="Pay" domain="[('account_id.type','=','payable')]" help="Payable payments"/>
386 <separator orientation="vertical"/>384 <separator/>
387 <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False)]" help="Unreconciled payments"/>385 <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False)]" help="Unreconciled payments"/>
388 <field name="account_id"/>386 <field name="account_id"/>
389 <field name="partner_id"/>387 <field name="partner_id"/>
390 <field name="invoice"/>388 <field name="invoice"/>
391 <field name="date_maturity"/>389 <field name="date_maturity"/>
392 <newline/>390 <separator/>
393 <field name="amount_to_pay"/>391 <field name="amount_to_pay"/>
394 <field name="payment_type" widget="selection"/>392 <field name="payment_type" widget="selection"/>
395 <field name="partner_bank_id"/>393 <field name="partner_bank_id"/>
396 <field name="received_check"/>394 <field name="received_check"/>
397 </group>395 <group expand="0" string="Group By...">
398 <newline/>396 <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
399 <group expand="0" string="Group By...">397 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
400 <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>398 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
401 <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>399 <separator/>
402 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>400 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
403 <separator orientation="vertical"/>401 <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>
404 <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>402 </group>
405 <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>403 </search>
406 </group>
407 </search>
408 </field>404 </field>
409 </record>405 </record>
410 -->406
411 <!-- Invoice Payments407 <!-- Invoice Payments -->
408
412 <record model="ir.actions.act_window" id="action_invoice_payments">409 <record model="ir.actions.act_window" id="action_invoice_payments">
413 <field name="name">Invoice payments</field>410 <field name="name">Invoice payments</field>
414 <field name="res_model">account.move.line</field>411 <field name="res_model">account.move.line</field>
@@ -417,9 +414,10 @@
417 <field name="search_view_id" ref="view_payments_filter"/>414 <field name="search_view_id" ref="view_payments_filter"/>
418 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','&lt;&gt;',False)]</field>415 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','&lt;&gt;',False)]</field>
419 </record>416 </record>
417
420 <menuitem name="Invoice payments" parent="account_payment.menu_main_payment" action="action_invoice_payments" id="menu_action_invoice_payments" sequence="4"/>418 <menuitem name="Invoice payments" parent="account_payment.menu_main_payment" action="action_invoice_payments" id="menu_action_invoice_payments" sequence="4"/>
421 -->419-
422 <!-- Done Payments420 <!-- Done Payments -->
423 <record model="ir.actions.act_window" id="action_done_payments">421 <record model="ir.actions.act_window" id="action_done_payments">
424 <field name="name">Done payments</field>422 <field name="name">Done payments</field>
425 <field name="res_model">account.move.line</field>423 <field name="res_model">account.move.line</field>
@@ -428,7 +426,8 @@
428 <field name="search_view_id" ref="view_payments_filter"/>426 <field name="search_view_id" ref="view_payments_filter"/>
429 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','=',False)]</field>427 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','=',False)]</field>
430 </record>428 </record>
429
431 <menuitem name="Done payments" parent="account_payment.menu_main_payment" action="action_done_payments" id="menu_action_done_payments" sequence="5"/>430 <menuitem name="Done payments" parent="account_payment.menu_main_payment" action="action_done_payments" id="menu_action_done_payments" sequence="5"/>
432 -->431
433</data>432</data>
434</openerp>433</openerp>
435\ No newline at end of file434\ No newline at end of file