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
1=== modified file 'account_payment_extension/account_move_line.py' (properties changed: -x to +x)
2--- account_payment_extension/account_move_line.py 2012-11-01 21:49:33 +0000
3+++ account_payment_extension/account_move_line.py 2013-01-02 17:55:31 +0000
4@@ -170,22 +170,29 @@
5 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check)
6 return super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check=False)
7
8- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
9- menus = [
10- self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_invoice_payments'),
11- self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_done_payments'),
12- ]
13- menus = [m[1] for m in menus]
14- if 'active_id' in context and context['active_id'] in menus:
15- # Use standard views for account.move.line object
16- if view_type == 'search':
17- # Get a specific search view (bug in 6.0RC1, it does not give the search view defined in the action window)
18- view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1]
19- result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
20- else:
21- # Use special views for account.move.line object (for ex. tree view contains user defined fields)
22- result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
23- return result
24+
25+#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
26+# required to port the following logic to v7.
27+#
28+# In the meantime, as the feature loss isn't that huge and as workarounds are possible we simply commented the following code out.
29+
30+# def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
31+# menus = [
32+# self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_invoice_payments'),
33+# self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_done_payments'),
34+# ]
35+#
36+# menus = [m[1] for m in menus]
37+# if 1==1: # 'active_id' in context and context['active_id'] in menus:
38+# # Use standard views for account.move.line object
39+# if view_type == 'search':
40+# # Get a specific search view (bug in 6.0RC1, it does not give the search view defined in the action window)
41+# view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1]
42+# result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
43+# else:
44+# # Use special views for account.move.line object (for ex. tree view contains user defined fields)
45+# result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
46+# return result
47
48 account_move_line()
49
50
51=== modified file 'account_payment_extension/payment_view.xml'
52--- account_payment_extension/payment_view.xml 2012-12-28 15:15:12 +0000
53+++ account_payment_extension/payment_view.xml 2013-01-02 17:55:31 +0000
54@@ -153,6 +153,7 @@
55 =================================================================================================
56 -->
57 <!--Field partner_bank_id in client invoices has a strange domain: domain="[('partner_id.ref_companies', 'in', [company_id])]"-->
58+
59 <record model="ir.ui.view" id="invoice_form3">
60 <field name="name">account.invoice.form3.payment_type</field>
61 <field name="model">account.invoice</field>
62@@ -163,15 +164,15 @@
63 <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
64 </field>
65 </field>
66- </record>
67-
68+ </record>
69+
70 <record model="ir.ui.view" id="invoice_form4">
71 <field name="name">account.invoice.form4.payment_type</field>
72 <field name="model">account.invoice</field>
73 <field name="type">form</field>
74 <field name="inherit_id" ref="account.invoice_form"/>
75 <field name="arch" type="xml">
76- <field name="address_invoice_id" position="after">
77+ <field name="fiscal_position" position="after">
78 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
79 </field>
80 </field>
81@@ -183,15 +184,14 @@
82 <field name="type">form</field>
83 <field name="inherit_id" ref="account.invoice_supplier_form"/>
84 <field name="arch" type="xml">
85- <field name="address_invoice_id" position="after">
86+ <field name="fiscal_position" position="after">
87 <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
88 </field>
89 </field>
90 </record>
91-
92+
93
94 <!--************ account.move.line extension to show additional fields **********-->
95- <!--
96 <record model="ir.ui.view" id="payments_move_line_tree">
97 <field name="name">account.payments.move.line.tree</field>
98 <field name="model">account.move.line</field>
99@@ -214,17 +214,16 @@
100 <field name="type">form</field>
101 <field name="inherit_id" ref="account.view_move_line_form"/>
102 <field name="arch" type="xml">
103- <separator string="Internal Note" position="before">
104- <group col="2" colspan="2">
105- <separator colspan="2" string="Payment"/>
106+ <field name="narration" position="before">
107+ <!-- <group col="2" colspan="2">
108+ <separator colspan="2" string="Payment"/> -->
109 <field name="payment_type" select="1" widget="selection"/>
110 <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/>
111 <field name="received_check"/>
112- </group>
113- </separator>
114+ <!-- </group> -->
115+ </field>
116 </field>
117 </record>
118- -->
119
120 <!--
121 ========================================================================================================
122@@ -346,7 +345,7 @@
123 =========================================================================================
124 PAYMENTS
125 =========================================================================================
126-
127+ -->
128 <record id="view_payments_tree" model="ir.ui.view">
129 <field name="name">Payments</field>
130 <field name="model">account.move.line</field>
131@@ -380,35 +379,33 @@
132 <field name="priority" eval="20"/>
133 <field name="arch" type="xml">
134 <search string="Search Invoice Payments">
135- <group col='10' colspan='4'>
136 <filter icon="terp-sale" string="Receive" domain="[('account_id.type','=','receivable')]" help="Receivable payments"/>
137 <filter icon="terp-purchase" string="Pay" domain="[('account_id.type','=','payable')]" help="Payable payments"/>
138- <separator orientation="vertical"/>
139+ <separator/>
140 <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False)]" help="Unreconciled payments"/>
141 <field name="account_id"/>
142 <field name="partner_id"/>
143 <field name="invoice"/>
144 <field name="date_maturity"/>
145- <newline/>
146+ <separator/>
147 <field name="amount_to_pay"/>
148 <field name="payment_type" widget="selection"/>
149 <field name="partner_bank_id"/>
150 <field name="received_check"/>
151- </group>
152- <newline/>
153- <group expand="0" string="Group By...">
154- <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
155- <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
156- <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
157- <separator orientation="vertical"/>
158- <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
159- <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>
160- </group>
161- </search>
162+ <group expand="0" string="Group By...">
163+ <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
164+ <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
165+ <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
166+ <separator/>
167+ <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
168+ <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>
169+ </group>
170+ </search>
171 </field>
172 </record>
173- -->
174- <!-- Invoice Payments
175+
176+ <!-- Invoice Payments -->
177+
178 <record model="ir.actions.act_window" id="action_invoice_payments">
179 <field name="name">Invoice payments</field>
180 <field name="res_model">account.move.line</field>
181@@ -417,9 +414,10 @@
182 <field name="search_view_id" ref="view_payments_filter"/>
183 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','&lt;&gt;',False)]</field>
184 </record>
185+
186 <menuitem name="Invoice payments" parent="account_payment.menu_main_payment" action="action_invoice_payments" id="menu_action_invoice_payments" sequence="4"/>
187- -->
188- <!-- Done Payments
189+-
190+ <!-- Done Payments -->
191 <record model="ir.actions.act_window" id="action_done_payments">
192 <field name="name">Done payments</field>
193 <field name="res_model">account.move.line</field>
194@@ -428,7 +426,8 @@
195 <field name="search_view_id" ref="view_payments_filter"/>
196 <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','=',False)]</field>
197 </record>
198+
199 <menuitem name="Done payments" parent="account_payment.menu_main_payment" action="action_done_payments" id="menu_action_done_payments" sequence="5"/>
200- -->
201+
202 </data>
203 </openerp>
204\ No newline at end of file