class DeliveryCarrierDatamodel(Datamodel): _name = "delivery.carrier" code = fields.Str(required=True) price_unit = fields.Decimal(required=True) discount = fields.Decimal() description = fields.Str()
class SaleOrderLineDatamodel(Datamodel): _name = "sale.order.line" product_code = fields.Str(required=True) qty = fields.Decimal(required=True) price_unit = fields.Decimal(required=True) description = fields.Str() discount = fields.Decimal()
class SaleOrderPaymentDatamodel(Datamodel): _name = "sale.order.payment" mode = fields.Str(required=True) amount = fields.Decimal(required=True) reference = fields.Str(required=True) currency_code = fields.Str(required=True) acquirer_reference = fields.Str()
class SaleOrderAddressDatamodel(Datamodel): _name = "sale.order.address" name = fields.Str(required=True) street = fields.Str(required=True) street2 = fields.Str(allow_none=True) zip = fields.Integer(required=True) city = fields.Str(required=True) email = fields.Email() state_code = fields.Str() country_code = fields.Str(required=True) phone = fields.Str() mobile = fields.Str()
class SaleOrderDatamodel(Datamodel): _name = "sale.order" name = fields.Str(required=True) address_customer = fields.NestedModel("sale.order.customer", required=True) address_shipping = fields.NestedModel("sale.order.address", required=True) address_invoicing = fields.NestedModel("sale.order.address", required=True) lines = fields.NestedModel("sale.order.line", many=True, required=True) amount = fields.NestedModel("sale.order.amount") invoice = fields.NestedModel("sale.order.invoice") payment = fields.NestedModel("sale.order.payment") pricelist_id = fields.Integer() date_order = fields.Date()
class AuthenticableSigninInput(Datamodel): _name = "authenticable.signin.input" login = fields.Str(required=True) password = fields.Str(required=True)
class AuthenticableSetPasswordInput(Datamodel): _name = "authenticable.set.password.input" token_set_password = fields.Str(required=True) password = fields.Str(required=True)
class AuthenticableForgetPasswordInput(Datamodel): _name = "authenticable.forget.password.input" login = fields.Str(required=True)
class SaleCancelInput(Datamodel): _name = "sale.cancel.input" sale_name = fields.Str()
class SaleOrderInvoiceDatamodel(Datamodel): _name = "sale.order.invoice" date = fields.Date(required=True) number = fields.Str(required=True)
class SaleOrderCustomerDatamodel(Datamodel): _inherit = "sale.order.address" _name = "sale.order.customer" external_id = fields.Str(required=True)