I have inherited pos.order model adding some extra fields and my definitions via custom module:
class PosOrderDV(models.Model):
_inherit = "pos.order"
profit = fields.Float('Lucro', store=True, index=True, digits=(5,2))
costs = fields.Float('Custos', store=True, index=True, digits=(5,2))
@api.multi
def cost_elab(self):
### do stuff ###
Odoo has his personal way to interact with fields trough definition, and I'm seeing a lack of good docs to archive that. Perhaps is better stay with my daemon, but I'm curious to know how people are managing the conversion.
For now, all I got were a series of errors, the most common are
ValueError: <type 'exceptions.AttributeError'>: "'pos.order' object has no attribute 'cost_elab'"
if I call my def with env['pos.order'].cost_elab()
or
NameError: name 'self' is not defined
if I use self.env['pos.order'].cost_elab()