[FIX] purchase: prevent changes when a line has an invoice
[FIX] purchase: prevent changes when a line has an invoice

Issue from rim:

    In runbot 12.3
    - Go to Purchase
    - Create a PO with one product line: qty 1 / unit price 1000
    - Validate the PO and create the Invoice
        => DON'T VALIDATE THE INVOICE YET
    - Go back to the PO, change the unit price to 2000
    - Go back to the invoice, validate it
    ==> the PO is marked as "fully invoiced" because the qty "1 unit"
        is counted as "invoiced"

    => we should not be able to change the price of a line that has
        already been invoiced, even in draft

Cause

    It seems that in all the PO's invoices state, we can edit a PO line.
    No restriction?

Solution

    Set the line price column to read only when they have a linked
    invoice.

OPW-2161477

closes odoo/odoo#42797

X-original-commit: b31c04040a2d7fe83741dec2d3a622487b7e46c3
Signed-off-by: Jason Van Malder <424e609fb79931407ad4e775601d20783b9f848f@users.noreply.github.com>

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo