Example #1
0
import logging
import time

from pytz import timezone

_logger = logging.getLogger(__name__)

# build dateutil helper, starting with the relevant *lazy* imports
import dateutil
import dateutil.parser
import dateutil.relativedelta
import dateutil.rrule
import dateutil.tz
mods = {'parser', 'relativedelta', 'rrule', 'tz'}
attribs = {atr for m in mods for atr in getattr(dateutil, m).__all__}
dateutil = wrap_module(dateutil, mods | attribs)


class IrActions(models.Model):
    _name = 'ir.actions.actions'
    _description = 'Actions'
    _table = 'ir_actions'
    _order = 'name'

    name = fields.Char(required=True)
    type = fields.Char(string='Action Type', required=True)
    xml_id = fields.Char(compute='_compute_xml_id', string="External ID")
    help = fields.Html(string='Action Description',
                       help='Optional help text for the users with a description of the target view, such as its usage and purpose.',
                       translate=True)
    binding_model_id = fields.Many2one('ir.model', ondelete='cascade',
Example #2
0
import logging
import time

from pytz import timezone

_logger = logging.getLogger(__name__)

# build dateutil helper, starting with the relevant *lazy* imports
import dateutil
import dateutil.parser
import dateutil.relativedelta
import dateutil.rrule
import dateutil.tz
mods = {'parser', 'relativedelta', 'rrule', 'tz'}
attribs = {atr for m in mods for atr in getattr(dateutil, m).__all__}
dateutil = wrap_module(dateutil, mods | attribs)


class IrActionsServer(models.Model):
    _inherit = 'ir.actions.server'

    @api.model
    def adms_method(self, operation, adms_id=False, fal_business_type=False):
        result = {
            'isSuccess': '',
            'ErrorMsg': '',
            'id_record': 0,
            'id_pc_journal': 0,
            'pc_journal': '',
            'id_issue_journal': 0,
            'issue_journal': '',
Example #3
0
     comment_start_string="<%doc>",
     comment_end_string="</%doc>",
     line_statement_prefix="%",
     line_comment_prefix="##",
     trim_blocks=True,  # do not output newline after blocks
     autoescape=True,  # XML/HTML automatic escaping
 )
 mako_template_env.globals.update({
     'str':
     str,
     'quote':
     urls.url_quote,
     'urlencode':
     urls.url_encode,
     'datetime':
     tools.wrap_module(datetime, []),
     'len':
     len,
     'abs':
     abs,
     'min':
     min,
     'max':
     max,
     'sum':
     sum,
     'filter':
     filter,
     'reduce':
     functools.reduce,
     'map':