Skip to content

[18.0] product_customerinfo_invoice: product_customer_code column visibility not honoring move type #2260

@fsmw

Description

@fsmw

Bug description

In 18.0, the invoice line list uses column_invisible=\"not partner_show_customer_code\" in product_customerinfo_invoice/views/account_move_view.xml. However, partner_show_customer_code is computed on account.move.line and is not available on the parent account.move record. In the invoice form list, the column visibility expression does not reflect the parent move type, so the product_customer_code column is not hidden when it should be (e.g., vendor bills).

Steps to reproduce

  1. Install product_customerinfo_invoice on 18.0.
  2. Open a vendor bill (or any non-sale move).
  3. Check the invoice line list: the product_customer_code column is still visible, although it should be hidden when is_sale_document() is false.

Expected behavior

product_customer_code column is hidden when the move is not a sale document.

Proposed fix

Compute partner_show_customer_code on account.move, add it to the form view as an invisible field, and reference it via parent.partner_show_customer_code in the invoice line list. Make the line field a related field to the parent.

Additional info

This seems to be a post‑migration regression in 18.0 after PR #2065.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions