Sale/Purchase move_done is incorrect for lines of type diferent than line
Currently it's possible to relate a product with a in comment line with the following steps:
1. Create a sale line of type 'line' and set a product.
2. Change the type of the line to comment. (product is hidden but already set)
If this is done, the line will be never marked as "send" as move_done[1] tests for the existences of a products and doesn't check the line type.
If you do this on a sale with invoice_method set to 'shipment', the invoice of the sale is never generated as the comment line never reaches the move_done state.
I propose to check the line type on get_move_done and return True if the line is different that 'line'.
I will upload a patch if the solution is accepted.
Other solutions can be:
- Clear product (and all other invisible fields) when changing the line type.
Purchase module is also affected.
I found it on 3.4 series and it's also affected on trunk, so I suspect that all the supported series are affected.
[1] http://hg.tryton.org/modules/sale/file/ddf64f59b9e8/sale.py#l1109