I have a very strange problem concerning the account.move.line and account. move. To the background: In the invoice line (One2many) regarding the additional custom fields added.
The values for the custom fields disappear on saving a draft invoice. But after posting an invoice you can add those data in a custom field and the value saved.
Here below my codes:
class invoice_move_line(models.Model):
_inherit = 'account.move.line'
name = fields.Char(string='Trailer No')
lot_no = fields.Char(string='Lot No')
product_id = fields.Many2one('product.product', string='Truck No')
driver_id = fields.Many2one('res.partner', string='Driver Name')
deal_no = fields.Char(string='Deal No')
itl_no = fields.Char(string='Itl No')
price_unit = fields.Float(string='Rate In', digits='Rate In')
quantity = fields.Float(string='Tons',
default=1.0, digits='Product Unit of Measure',
help="The optional quantity expressed by this line, eg: number of product sold. "
"The quantity is not a legal requirement but is very useful for some reports.")
Account invoice View
account.move