class User(UserMixin, Model): """ A user of the app. """ __model_name__ = 'res.user' login = StringType(required=True) name = StringType(required=True) active = BooleanType(required=True) @classmethod def authenticate(cls, login, password): response = cls.rpc.client.login(login, password) if response: return User.get_by_id(response[0]) return None
class User(UserMixin, Model): """ A user of the app. """ __model_name__ = 'res.user' id = IntType(required=True) login = StringType(required=True) name = StringType(required=True) active = BooleanType(required=True) @property def is_active(self): return self.active def get_id(self): return self.id and str(self.id)
class ContactModel(Model): __model_name__ = 'party.party' name = StringType() credit_limit_amount = MoneyType('currency_code') @property def currency_code(self): return 'USD'
class SaleOrderModel(Model): __model_name__ = 'sale.sale' _eager_fields = set(['currency.code']) number = StringType() total_amount = MoneyType('currency_code') @property def currency_code(self): return self._values['currency.code']
class ModuleModel(Model): __model_name__ = 'ir.module' name = StringType()
class ResUserModel(Model): __model_name__ = 'res.user' name = StringType()
class Sale(shop.cart.models.Sale): flipgive_campaign = ModelType("flipgive.campaign") flipgive_token = StringType()
class FlipGiveCampaign(Model): __model_name__ = 'flipgive.campaign' name = StringType() campaign_id = StringType()