|
@@ -9,6 +9,8 @@ class ResConfig(models.TransientModel):
|
|
|
image_type = fields.Selection(selection=[('small', 'Pequeña'), ('big', 'Grande')], default='small', string='Imagen', required=True)
|
|
|
allow_currency_exchange = fields.Boolean(default=False, string='Permitir cambiar moneda')
|
|
|
view_currency_exchanges = fields.Boolean(default=False, string='Permitir ver cambio de monedas')
|
|
|
+ allow_change_user = fields.Boolean(default=False, string='Permitir cambiar el usuario')
|
|
|
+ allow_change_date = fields.Boolean(default=False, string='Permitir cambiar la fecha')
|
|
|
currency_ids = fields.Many2many('res.currency', string='Monedas')
|
|
|
|
|
|
'''
|
|
@@ -20,16 +22,19 @@ class ResConfig(models.TransientModel):
|
|
|
ir_config.set_param('eiru_pos.image_type', str(self.image_type))
|
|
|
ir_config.set_param('eiru_pos.allow_currency_exchange', repr(self.allow_currency_exchange))
|
|
|
ir_config.set_param('eiru_pos.view_currency_exchanges', repr(self.view_currency_exchanges))
|
|
|
+ ir_config.set_param('eiru_pos.allow_change_user', repr(self.allow_change_user))
|
|
|
+ ir_config.set_param('eiru_pos.allow_change_date', repr(self.allow_change_date))
|
|
|
ir_config.set_param('eiru_pos.currency_ids', repr(self.currency_ids.mapped(lambda x: x.id)))
|
|
|
|
|
|
@api.model
|
|
|
def get_default_settings(self, fields):
|
|
|
ir_config = self.env['ir.config_parameter']
|
|
|
- res_currency = self.env['res.currency']
|
|
|
|
|
|
return {
|
|
|
'image_type': ir_config.get_param('eiru_pos.image_type', 'small'),
|
|
|
'allow_currency_exchange': safe_eval(ir_config.get_param('eiru_pos.allow_currency_exchange', 'False')),
|
|
|
'view_currency_exchanges': safe_eval(ir_config.get_param('eiru_pos.view_currency_exchanges', 'False')),
|
|
|
+ 'allow_change_user': safe_eval(ir_config.get_param('eiru_pos.allow_change_user', 'False')),
|
|
|
+ 'allow_change_date': safe_eval(ir_config.get_param('eiru_pos.allow_change_date', 'False')),
|
|
|
'currency_ids': safe_eval(ir_config.get_param('eiru_pos.currency_ids', '[]'))
|
|
|
}
|