Merge lp://staging/~camptocamp/department-mgmt/7.0-port-sale_department into lp://staging/~department-core-editors/department-mgmt/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Approved by: Daniel Reis
Approved revision: 18
Merged at revision: 15
Proposed branch: lp://staging/~camptocamp/department-mgmt/7.0-port-sale_department
Merge into: lp://staging/~department-core-editors/department-mgmt/7.0
Diff against target: 318 lines (+134/-131)
4 files modified
sale_department/__init__.py (+3/-1)
sale_department/__openerp__.py (+33/-46)
sale_department/sale.py (+46/-40)
sale_department/sale_view.xml (+52/-44)
To merge this branch: bzr merge lp://staging/~camptocamp/department-mgmt/7.0-port-sale_department
Reviewer Review Type Date Requested Status
Daniel Reis tested install, no errors. Approve
Nhomar - Vauxoo Approve
Review via email: mp+170248@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Approve.

Just Code Review. No test.

review: Approve
Revision history for this message
Daniel Reis (dreis-pt) wrote :

Hmmm ... my tests return an error message when installing.
Maybe this happens because I don't have multicompany installed?

2013-07-15 16:57:25,471 26929 ERROR dept7-dev openerp.tools.convert: Parse error in /opt/openerp/dept7/dev/department-mgmt/invoice_department/invoice_view.xml:16:
<record id="invoice_form" model="ir.ui.view">
      <field name="name">account.invoice.form</field>
      <field name="model">account.invoice</field>
      <field name="inherit_id" ref="account.invoice_form"/>
      <field name="arch" type="xml">
        <field name="company_id" position="before">
          <field name="department_id" widget="selection"/>
        </field>
      </field>
    </record>
(...)
2013-07-15 16:57:25,475 26929 ERROR dept7-dev openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!

review: Needs Information
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

This issue doesn't seems to come from sale_department but from its dependency invoice_department which conflicts with portal_sale (auto installed with portal and sale thus with sale_department).

To complete install of sale_department from scratch I had to do those steps:

- comment invoice_form and invoice_supplier_form in invoice_department/invoice_view.xml
- comment invoice_form_payment in portal_sale/portal_sale_view.xml
- launch OpenERP with --update=all
- uncomment view in portal_sale
- launch OpenERP with --update=portal_sale
- uncomment view in invoice_department
- launch OpenERP with --update=invoice_department

I guess this is due to some OpenERP bug in view inheritance...

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Somehow, on update of portal_sale, it uses some cached view trying to read department_id before it has been defined by invoice_department.

We cannot make invoice_department depending on portal_sale as it doesn't make sense. Let's see if a new bug report on view inheritance bring us some solution to this.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Finally it seems it is simply in invoice_department that we try to add the field department_id before company_id of invoice line instead of doing it before the company_id of invoice. Funny I could install invoice_department anyway...

Revision history for this message
Daniel Reis (dreis-pt) wrote :

As a suggestion for future improvement:
From a usability PoV, the widget "selection" is only appropriate for small lists of items (less than a handfull).
In this case, when the Department list grows significantly (in my case, many dozens of records) it gets harder to use.
So, the default v7 search-as-you-type list widget will probably be more adequate here.

review: Approve (tested install, no errors.)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the review.

You are right using completion instead of selection makes sense with dozens of departments.
I kept it like this as we haven't such case with that many departments but to be more generic it would be a good improvement.

Actually we have half of department-mgmt using selection and half using default completion.

So we will have to change it in the following modules:
crm_department
invoice_department
sale_department

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches