Merge lp:~mileo/account-payment/7.0 into lp:~account-payment-team/account-payment/7.0
- 7.0
- Merge into 7.0
Proposed by
Luis Felipe Miléo - http://www.kmee.com.br
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Valyi - http://www.akretion.com | Pending | ||
Review via email:
|
Commit message
Description of the change
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 | 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) |
6 | 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) |
7 | 172 | 172 | ||
24 | 173 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): | 173 | |
25 | 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 |
26 | 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. |
27 | 176 | self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_done_payments'), | 176 | # |
28 | 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. |
29 | 178 | menus = [m[1] for m in menus] | 178 | |
30 | 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): |
31 | 180 | # Use standard views for account.move.line object | 180 | # menus = [ |
32 | 181 | if view_type == 'search': | 181 | # self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'menu_action_invoice_payments'), |
33 | 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'), |
34 | 183 | view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1] | 183 | # ] |
35 | 184 | result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) | 184 | # |
36 | 185 | else: | 185 | # menus = [m[1] for m in menus] |
37 | 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: |
38 | 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 |
39 | 188 | return result | 188 | # if view_type == 'search': |
40 | 189 | # # Get a specific search view (bug in 6.0RC1, it does not give the search view defined in the action window) | ||
41 | 190 | # view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_payment_extension', 'view_payments_filter')[1] | ||
42 | 191 | # result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) | ||
43 | 192 | # else: | ||
44 | 193 | # # Use special views for account.move.line object (for ex. tree view contains user defined fields) | ||
45 | 194 | # result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) | ||
46 | 195 | # return result | ||
47 | 189 | 196 | ||
48 | 190 | account_move_line() | 197 | account_move_line() |
49 | 191 | 198 | ||
50 | 192 | 199 | ||
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 | 153 | ================================================================================================= | 153 | ================================================================================================= |
56 | 154 | --> | 154 | --> |
57 | 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])]"--> |
58 | 156 | |||
59 | 156 | <record model="ir.ui.view" id="invoice_form3"> | 157 | <record model="ir.ui.view" id="invoice_form3"> |
60 | 157 | <field name="name">account.invoice.form3.payment_type</field> | 158 | <field name="name">account.invoice.form3.payment_type</field> |
61 | 158 | <field name="model">account.invoice</field> | 159 | <field name="model">account.invoice</field> |
62 | @@ -163,15 +164,15 @@ | |||
63 | 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)"/> |
64 | 164 | </field> | 165 | </field> |
65 | 165 | </field> | 166 | </field> |
68 | 166 | </record> | 167 | </record> |
69 | 167 | 168 | ||
70 | 168 | <record model="ir.ui.view" id="invoice_form4"> | 169 | <record model="ir.ui.view" id="invoice_form4"> |
71 | 169 | <field name="name">account.invoice.form4.payment_type</field> | 170 | <field name="name">account.invoice.form4.payment_type</field> |
72 | 170 | <field name="model">account.invoice</field> | 171 | <field name="model">account.invoice</field> |
73 | 171 | <field name="type">form</field> | 172 | <field name="type">form</field> |
74 | 172 | <field name="inherit_id" ref="account.invoice_form"/> | 173 | <field name="inherit_id" ref="account.invoice_form"/> |
75 | 173 | <field name="arch" type="xml"> | 174 | <field name="arch" type="xml"> |
77 | 174 | <field name="address_invoice_id" position="after"> | 175 | <field name="fiscal_position" position="after"> |
78 | 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)" /> |
79 | 176 | </field> | 177 | </field> |
80 | 177 | </field> | 178 | </field> |
81 | @@ -183,15 +184,14 @@ | |||
82 | 183 | <field name="type">form</field> | 184 | <field name="type">form</field> |
83 | 184 | <field name="inherit_id" ref="account.invoice_supplier_form"/> | 185 | <field name="inherit_id" ref="account.invoice_supplier_form"/> |
84 | 185 | <field name="arch" type="xml"> | 186 | <field name="arch" type="xml"> |
86 | 186 | <field name="address_invoice_id" position="after"> | 187 | <field name="fiscal_position" position="after"> |
87 | 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)" /> |
88 | 188 | </field> | 189 | </field> |
89 | 189 | </field> | 190 | </field> |
90 | 190 | </record> | 191 | </record> |
92 | 191 | 192 | ||
93 | 192 | 193 | ||
94 | 193 | <!--************ account.move.line extension to show additional fields **********--> | 194 | <!--************ account.move.line extension to show additional fields **********--> |
95 | 194 | <!-- | ||
96 | 195 | <record model="ir.ui.view" id="payments_move_line_tree"> | 195 | <record model="ir.ui.view" id="payments_move_line_tree"> |
97 | 196 | <field name="name">account.payments.move.line.tree</field> | 196 | <field name="name">account.payments.move.line.tree</field> |
98 | 197 | <field name="model">account.move.line</field> | 197 | <field name="model">account.move.line</field> |
99 | @@ -214,17 +214,16 @@ | |||
100 | 214 | <field name="type">form</field> | 214 | <field name="type">form</field> |
101 | 215 | <field name="inherit_id" ref="account.view_move_line_form"/> | 215 | <field name="inherit_id" ref="account.view_move_line_form"/> |
102 | 216 | <field name="arch" type="xml"> | 216 | <field name="arch" type="xml"> |
106 | 217 | <separator string="Internal Note" position="before"> | 217 | <field name="narration" position="before"> |
107 | 218 | <group col="2" colspan="2"> | 218 | <!-- <group col="2" colspan="2"> |
108 | 219 | <separator colspan="2" string="Payment"/> | 219 | <separator colspan="2" string="Payment"/> --> |
109 | 220 | <field name="payment_type" select="1" widget="selection"/> | 220 | <field name="payment_type" select="1" widget="selection"/> |
110 | 221 | <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/> | 221 | <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/> |
111 | 222 | <field name="received_check"/> | 222 | <field name="received_check"/> |
114 | 223 | </group> | 223 | <!-- </group> --> |
115 | 224 | </separator> | 224 | </field> |
116 | 225 | </field> | 225 | </field> |
117 | 226 | </record> | 226 | </record> |
118 | 227 | --> | ||
119 | 228 | 227 | ||
120 | 229 | <!-- | 228 | <!-- |
121 | 230 | ======================================================================================================== | 229 | ======================================================================================================== |
122 | @@ -346,7 +345,7 @@ | |||
123 | 346 | ========================================================================================= | 345 | ========================================================================================= |
124 | 347 | PAYMENTS | 346 | PAYMENTS |
125 | 348 | ========================================================================================= | 347 | ========================================================================================= |
127 | 349 | 348 | --> | |
128 | 350 | <record id="view_payments_tree" model="ir.ui.view"> | 349 | <record id="view_payments_tree" model="ir.ui.view"> |
129 | 351 | <field name="name">Payments</field> | 350 | <field name="name">Payments</field> |
130 | 352 | <field name="model">account.move.line</field> | 351 | <field name="model">account.move.line</field> |
131 | @@ -380,35 +379,33 @@ | |||
132 | 380 | <field name="priority" eval="20"/> | 379 | <field name="priority" eval="20"/> |
133 | 381 | <field name="arch" type="xml"> | 380 | <field name="arch" type="xml"> |
134 | 382 | <search string="Search Invoice Payments"> | 381 | <search string="Search Invoice Payments"> |
135 | 383 | <group col='10' colspan='4'> | ||
136 | 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"/> |
137 | 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"/> |
139 | 386 | <separator orientation="vertical"/> | 384 | <separator/> |
140 | 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"/> |
141 | 388 | <field name="account_id"/> | 386 | <field name="account_id"/> |
142 | 389 | <field name="partner_id"/> | 387 | <field name="partner_id"/> |
143 | 390 | <field name="invoice"/> | 388 | <field name="invoice"/> |
144 | 391 | <field name="date_maturity"/> | 389 | <field name="date_maturity"/> |
146 | 392 | <newline/> | 390 | <separator/> |
147 | 393 | <field name="amount_to_pay"/> | 391 | <field name="amount_to_pay"/> |
148 | 394 | <field name="payment_type" widget="selection"/> | 392 | <field name="payment_type" widget="selection"/> |
149 | 395 | <field name="partner_bank_id"/> | 393 | <field name="partner_bank_id"/> |
150 | 396 | <field name="received_check"/> | 394 | <field name="received_check"/> |
162 | 397 | </group> | 395 | <group expand="0" string="Group By..."> |
163 | 398 | <newline/> | 396 | <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/> |
164 | 399 | <group expand="0" string="Group By..."> | 397 | <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/> |
165 | 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'}"/> |
166 | 401 | <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/> | 399 | <separator/> |
167 | 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'}"/> |
168 | 403 | <separator orientation="vertical"/> | 401 | <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/> |
169 | 404 | <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/> | 402 | </group> |
170 | 405 | <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/> | 403 | </search> |
160 | 406 | </group> | ||
161 | 407 | </search> | ||
171 | 408 | </field> | 404 | </field> |
172 | 409 | </record> | 405 | </record> |
175 | 410 | --> | 406 | |
176 | 411 | <!-- Invoice Payments | 407 | <!-- Invoice Payments --> |
177 | 408 | |||
178 | 412 | <record model="ir.actions.act_window" id="action_invoice_payments"> | 409 | <record model="ir.actions.act_window" id="action_invoice_payments"> |
179 | 413 | <field name="name">Invoice payments</field> | 410 | <field name="name">Invoice payments</field> |
180 | 414 | <field name="res_model">account.move.line</field> | 411 | <field name="res_model">account.move.line</field> |
181 | @@ -417,9 +414,10 @@ | |||
182 | 417 | <field name="search_view_id" ref="view_payments_filter"/> | 414 | <field name="search_view_id" ref="view_payments_filter"/> |
183 | 418 | <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','<>',False)]</field> | 415 | <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','<>',False)]</field> |
184 | 419 | </record> | 416 | </record> |
185 | 417 | |||
186 | 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"/> |
189 | 421 | --> | 419 | - |
190 | 422 | <!-- Done Payments | 420 | <!-- Done Payments --> |
191 | 423 | <record model="ir.actions.act_window" id="action_done_payments"> | 421 | <record model="ir.actions.act_window" id="action_done_payments"> |
192 | 424 | <field name="name">Done payments</field> | 422 | <field name="name">Done payments</field> |
193 | 425 | <field name="res_model">account.move.line</field> | 423 | <field name="res_model">account.move.line</field> |
194 | @@ -428,7 +426,8 @@ | |||
195 | 428 | <field name="search_view_id" ref="view_payments_filter"/> | 426 | <field name="search_view_id" ref="view_payments_filter"/> |
196 | 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> |
197 | 430 | </record> | 428 | </record> |
198 | 429 | |||
199 | 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"/> |
201 | 432 | --> | 431 | |
202 | 433 | </data> | 432 | </data> |
203 | 434 | </openerp> | 433 | </openerp> |
204 | 435 | \ No newline at end of file | 434 | \ No newline at end of file |