Merge lp:~camptocamp/account-invoice-report/better-invoice-line-layout into lp:~account-core-editors/account-invoice-report/7.0

Proposed by Nicolas Bessi - Camptocamp
Status: Merged
Merged at revision: 24
Proposed branch: lp:~camptocamp/account-invoice-report/better-invoice-line-layout
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 20 lines (+11/-0)
1 file modified
invoice_webkit/view/invoice_view.xml (+11/-0)
To merge this branch: bzr merge lp:~camptocamp/account-invoice-report/better-invoice-line-layout
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Alexandre Fayolle - camptocamp Approve
Review via email: mp+150578@code.launchpad.net

Description of the change

Remove product for invoice line list view as it is not shown in report and line is editable in form mode. It may also avoid nasty layout overlapping.

We also neutralize the product_id on change in list view.

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Alexandre,

a minor remark: you could be less brutal than replace and use
position="attributes" instead of position="replace"
and then inside the field:
<attribute name="invisible">1</attribute>

It's a bit more robust if product_id has been customized some way.

LGBT aussi

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

I agree with Raphaël. I would consider the full replacement of the field as a bad practice versus to change only the attribute.

l.9: typo s/imporve/improve/

review: Needs Fixing
24. By Guewen Baconnier @ Camptocamp

[FIX] do not replace completely the field, change the 'invisible' attribute instead

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Made the changes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'invoice_webkit/view/invoice_view.xml'
2--- invoice_webkit/view/invoice_view.xml 2013-01-31 13:06:26 +0000
3+++ invoice_webkit/view/invoice_view.xml 2013-03-04 06:53:23 +0000
4@@ -99,5 +99,16 @@
5 </field>
6 </record>
7
8+ <record model="ir.ui.view" id="invoice_improve_line_tree">
9+ <field name="name">account.invoiceline.improve.line</field>
10+ <field name="model">account.invoice</field>
11+ <field name="inherit_id" ref="account.invoice_form"/>
12+ <field name="arch" type="xml">
13+ <xpath expr="//field[@name='invoice_line']/tree/field[@name='product_id']" position="attributes">
14+ <attribute name="invisible">1</attribute>
15+ </xpath>
16+ </field>
17+ </record>
18+
19 </data>
20 </openerp>

Subscribers

People subscribed via source and target branches