def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'pt_data_point',
                           [('prod_cat', 'VARCHAR'),
                            ('prod', 'VARCHAR'),
                            ('lot', 'VARCHAR'),
                            ('qty', 'NUMERIC'),
                            ('uom', 'TEXT')])
     create_composite_type(cr, 'pt_decorated_record',
                           [('nth', 'BIGINT'),
                            ('decorator_consumed_prod', 'BOOLEAN'),
                            ('decorator_consumed_subtotal', 'BOOLEAN'),
                            ('decorator_finished_prod', 'BOOLEAN'),
                            ('decorator_finished_subtotal', 'BOOLEAN'),
                            ('consumed_prod_cat', 'VARCHAR'),
                            ('consumed_prod', 'VARCHAR'),
                            ('consumed_lot', 'VARCHAR'),
                            ('consumed_qty', 'NUMERIC'),
                            ('consumed_uom', 'TEXT'),
                            ('finished_prod_cat', 'VARCHAR'),
                            ('finished_prod', 'VARCHAR'),
                            ('finished_lot', 'VARCHAR'),
                            ('finished_qty', 'NUMERIC'),
                            ('finished_uom', 'TEXT')])
     create_plpgsql_proc(cr, 'pt_decorator',
                         [('IN', 'consumed_data', 'PT_DATA_POINT[]'),
                          ('IN', 'finished_data', 'PT_DATA_POINT[]')],
                         'SETOF PT_DECORATED_RECORD',
                         _PT_DECORATOR_DEF)
Example #2
0
 def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'pt_data_point', [('prod_cat', 'VARCHAR'),
                                                 ('prod', 'VARCHAR'),
                                                 ('lot', 'VARCHAR'),
                                                 ('qty', 'NUMERIC'),
                                                 ('uom', 'TEXT')])
     create_composite_type(cr, 'pt_decorated_record',
                           [('nth', 'BIGINT'),
                            ('decorator_consumed_prod', 'BOOLEAN'),
                            ('decorator_consumed_subtotal', 'BOOLEAN'),
                            ('decorator_finished_prod', 'BOOLEAN'),
                            ('decorator_finished_subtotal', 'BOOLEAN'),
                            ('consumed_prod_cat', 'VARCHAR'),
                            ('consumed_prod', 'VARCHAR'),
                            ('consumed_lot', 'VARCHAR'),
                            ('consumed_qty', 'NUMERIC'),
                            ('consumed_uom', 'TEXT'),
                            ('finished_prod_cat', 'VARCHAR'),
                            ('finished_prod', 'VARCHAR'),
                            ('finished_lot', 'VARCHAR'),
                            ('finished_qty', 'NUMERIC'),
                            ('finished_uom', 'TEXT')])
     create_plpgsql_proc(cr, 'pt_decorator',
                         [('IN', 'consumed_data', 'PT_DATA_POINT[]'),
                          ('IN', 'finished_data', 'PT_DATA_POINT[]')],
                         'SETOF PT_DECORATED_RECORD', _PT_DECORATOR_DEF)
Example #3
0
 def _auto_init(self, cr, context=None):
     super(cash_flow_realization_report, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'vcf_tuple',
                           [('id', 'BIGINT'),
                            ('date', 'DATE'),
                            ('type', 'INT'),
                            ('bank_acc_id', 'BIGINT')])
     create_plpgsql_proc(cr, 'cash_flow_items',
                         [('IN', 'date_start', 'DATE'),
                          ('IN', 'date_end', 'DATE'),
                          ('IN', 'company_ids', 'INTEGER[]'),
                          ('IN', 'account_ids', 'INTEGER[]')],
                         'TABLE(type_ CHARACTER VARYING, id_ BIGINT, date_ DATE, bank_acc_id_ BIGINT)',
                         def_cash_flow_items_sql())
Example #4
0
 def _auto_init(self, cr, context=None):
     super(tree_node, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'via_tree_node', [('id', 'BIGINT'),
                                                 ('parent_id', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_unrolled',
                           [('id', 'BIGINT'), ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'), ('parent_left', 'BIGINT'),
                            ('parent_right', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_level_tagger_datum',
                           [('id', 'BIGINT'), ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'),
                            ('unrolling_pid', 'BIGINT'),
                            ('unique_id', 'BIGINT'),
                            ('unique_parent_id', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_child_count',
                           [('id', 'BIGINT'), ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'), ('unique_id', 'BIGINT'),
                            ('unique_parent_id', 'BIGINT'),
                            ('child_count', 'BIGINT')])
     create_plpgsql_proc(cr, 'via_tree_node_unroller',
                         [('IN', 'tree_nodes', 'VIA_TREE_NODE[]')],
                         'SETOF VIA_TREE_NODE_LEVEL_TAGGER_DATUM',
                         via_tree_node_unroller_def)
     create_plpgsql_proc(cr, 'via_tree_node_count_children', [
         ('IN', 'unrolled_tree_nodes', 'VIA_TREE_NODE_LEVEL_TAGGER_DATUM[]')
     ], 'SETOF VIA_TREE_NODE_CHILD_COUNT', via_tree_node_count_children_def)
     create_plpgsql_proc(cr, 'via_tree_node_parent_left_right_tagger', [
         ('IN', 'unrolled_tree_nodes', 'VIA_TREE_NODE_CHILD_COUNT[]')
     ], 'SETOF VIA_TREE_NODE_UNROLLED',
                         via_tree_node_parent_left_right_tagger_def)
     create_plpgsql_proc(cr, 'via_tree_node_level_tagger',
                         [('IN', 'tree_nodes', 'VIA_TREE_NODE[]')],
                         'SETOF VIA_TREE_NODE_UNROLLED',
                         via_tree_node_level_tagger_def)
 def _auto_init(self, cr, context=None):
     super(cash_flow_realization_report, self)._auto_init(cr, context=context)
     create_composite_type(
         cr, "vcf_tuple", [("id", "BIGINT"), ("date", "DATE"), ("type", "INT"), ("bank_acc_id", "BIGINT")]
     )
     create_plpgsql_proc(
         cr,
         "cash_flow_items",
         [
             ("IN", "date_start", "DATE"),
             ("IN", "date_end", "DATE"),
             ("IN", "company_ids", "INTEGER[]"),
             ("IN", "account_ids", "INTEGER[]"),
         ],
         "TABLE(type_ CHARACTER VARYING, id_ BIGINT, date_ DATE, bank_acc_id_ BIGINT)",
         def_cash_flow_items_sql(),
     )
Example #6
0
 def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'srr_axes', [('prod_cat', 'VARCHAR'),
                                            ('year', 'DATE'),
                                            ('month', 'DATE'),
                                            ('period_start', 'DATE'),
                                            ('period_stop', 'DATE')])
     create_composite_type(cr, 'srr_data_point', [('prod_cat', 'VARCHAR'),
                                                  ('prod', 'VARCHAR'),
                                                  ('year', 'DATE'),
                                                  ('month', 'DATE'),
                                                  ('weight', 'NUMERIC'),
                                                  ('sales', 'NUMERIC')])
     create_composite_type(cr, 'srr_decorated_record',
                           [('nth', 'BIGINT'),
                            ('decorator_prod_cat_header', 'BOOLEAN'),
                            ('decorator_prod', 'BOOLEAN'),
                            ('decorator_prod_cat_footer', 'BOOLEAN'),
                            ('prod_cat', 'VARCHAR'), ('prod', 'VARCHAR'),
                            ('year', 'DATE'), ('month', 'DATE'),
                            ('weight', 'NUMERIC'), ('sales', 'NUMERIC')])
     create_plpgsql_proc(cr, 'srr_decorator',
                         [('IN', 'sales_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'refund_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'credit_notes_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'other_cat_name', 'VARCHAR')],
                         'SETOF SRR_DECORATED_RECORD', _SRR_DECORATOR_DEF)
 def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'srr_axes',
                           [('prod_cat', 'VARCHAR'),
                            ('year', 'DATE'),
                            ('month', 'DATE'),
                            ('period_start', 'DATE'),
                            ('period_stop', 'DATE')])
     create_composite_type(cr, 'srr_data_point',
                           [('prod_cat', 'VARCHAR'),
                            ('prod', 'VARCHAR'),
                            ('year', 'DATE'),
                            ('month', 'DATE'),
                            ('weight', 'NUMERIC'),
                            ('sales', 'NUMERIC')])
     create_composite_type(cr, 'srr_decorated_record',
                           [('nth', 'BIGINT'),
                            ('decorator_prod_cat_header', 'BOOLEAN'),
                            ('decorator_prod', 'BOOLEAN'),
                            ('decorator_prod_cat_footer', 'BOOLEAN'),
                            ('prod_cat', 'VARCHAR'),
                            ('prod', 'VARCHAR'),
                            ('year', 'DATE'),
                            ('month', 'DATE'),
                            ('weight', 'NUMERIC'),
                            ('sales', 'NUMERIC')])
     create_plpgsql_proc(cr, 'srr_decorator',
                         [('IN', 'sales_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'refund_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'credit_notes_data', 'SRR_DATA_POINT[]'),
                          ('IN', 'other_cat_name', 'VARCHAR')],
                         'SETOF SRR_DECORATED_RECORD',
                         _SRR_DECORATOR_DEF)
 def _auto_init(self, cr, context=None):
     super(tree_node, self)._auto_init(cr, context=context)
     create_composite_type(cr, 'via_tree_node',
                           [('id', 'BIGINT'),
                            ('parent_id', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_unrolled',
                           [('id', 'BIGINT'),
                            ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'),
                            ('parent_left', 'BIGINT'),
                            ('parent_right', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_level_tagger_datum',
                           [('id', 'BIGINT'),
                            ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'),
                            ('unrolling_pid', 'BIGINT'),
                            ('unique_id', 'BIGINT'),
                            ('unique_parent_id', 'BIGINT')])
     create_composite_type(cr, 'via_tree_node_child_count',
                           [('id', 'BIGINT'),
                            ('parent_id', 'BIGINT'),
                            ('level', 'BIGINT'),
                            ('unique_id', 'BIGINT'),
                            ('unique_parent_id', 'BIGINT'),
                            ('child_count', 'BIGINT')])
     create_plpgsql_proc(cr, 'via_tree_node_unroller',
                         [('IN', 'tree_nodes', 'VIA_TREE_NODE[]')],
                         'SETOF VIA_TREE_NODE_LEVEL_TAGGER_DATUM',
                         via_tree_node_unroller_def)
     create_plpgsql_proc(cr, 'via_tree_node_count_children',
                         [('IN', 'unrolled_tree_nodes', 'VIA_TREE_NODE_LEVEL_TAGGER_DATUM[]')],
                         'SETOF VIA_TREE_NODE_CHILD_COUNT',
                         via_tree_node_count_children_def)
     create_plpgsql_proc(cr, 'via_tree_node_parent_left_right_tagger',
                         [('IN', 'unrolled_tree_nodes', 'VIA_TREE_NODE_CHILD_COUNT[]')],
                         'SETOF VIA_TREE_NODE_UNROLLED',
                         via_tree_node_parent_left_right_tagger_def)
     create_plpgsql_proc(cr, 'via_tree_node_level_tagger',
                         [('IN', 'tree_nodes', 'VIA_TREE_NODE[]')],
                         'SETOF VIA_TREE_NODE_UNROLLED',
                         via_tree_node_level_tagger_def)
 def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_plpgsql_proc(cr, 'gl_array_cat',
                         [('IN', 'array_1', 'BIGINT[]'),
                          ('IN', 'array_2', 'BIGINT[]')],
                         'BIGINT[]',
                         _GL_ARRAY_CAT_DEF)
     create_aggregator(cr, 'gl_array_reduce', 'BIGINT[]',
                       {'sfunc': 'gl_array_cat',
                        'stype': 'BIGINT[]'})
     create_composite_type(cr, 'gl_journal_item',
                           [('id', 'BIGINT'),
                            ('date', 'DATE'),
                            ('no', 'VARCHAR'),
                            ('partner', 'VARCHAR'),
                            ('remarks', 'VARCHAR'),
                            ('debit', 'NUMERIC'),
                            ('credit', 'NUMERIC'),
                            ('top_level_debit', 'NUMERIC'),
                            ('top_level_credit', 'NUMERIC'),
                            ('comparison_order', 'BIGINT'),
                            ('com_id', 'BIGINT')])
     create_composite_type(cr, 'gl_axes_data_point',
                           [('decorator_bold', 'BOOLEAN'),
                            ('decorator_underline', 'BOOLEAN'),
                            ('decorator_italic', 'BOOLEAN'),
                            ('decorator_move_bold', 'BOOLEAN'),
                            ('decorator_move_underline', 'BOOLEAN'),
                            ('decorator_move_italic', 'BOOLEAN'),
                            ('decorator_blank_line', 'BOOLEAN'),
                            ('decorator_title_line', 'BOOLEAN'),
                            ('rtn_order', 'BIGINT'),
                            ('comparison_order', 'BIGINT'),
                            ('comparison_label', 'VARCHAR'),
                            ('com_order', 'BIGINT'),
                            ('com_id', 'BIGINT'),
                            ('com_name', 'VARCHAR'),
                            ('rtn_name', 'VARCHAR'),
                            ('rtn_level', 'BIGINT'),
                            ('bb', 'NUMERIC'),
                            ('dr', 'NUMERIC'),
                            ('cr', 'NUMERIC'),
                            ('mv', 'NUMERIC'),
                            ('eb', 'NUMERIC'),
                            ('move_lines_count', 'NUMERIC'),
                            ('move_lines', 'BIGINT[]')])
     create_composite_type(cr, 'gl_decorated_record',
                           [('decorator_header_band_selector', 'INT'),
                            ('decorator_band_selector', 'INT'),
                            ('decorator_bold', 'BOOLEAN'),
                            ('decorator_underline', 'BOOLEAN'),
                            ('decorator_italic', 'BOOLEAN'),
                            ('decorator_move_bold', 'BOOLEAN'),
                            ('decorator_move_underline', 'BOOLEAN'),
                            ('decorator_move_italic', 'BOOLEAN'),
                            ('decorator_blank_line', 'BOOLEAN'),
                            ('decorator_title_line', 'BOOLEAN'),
                            ('nth_row', 'BIGINT'),
                            ('comparison_order', 'BIGINT'),
                            ('comparison_label', 'VARCHAR'),
                            ('com_order', 'BIGINT'),
                            ('com_name', 'VARCHAR'),
                            ('rtn_name', 'VARCHAR'),
                            ('rtn_level', 'BIGINT'),
                            ('bb', 'NUMERIC'),
                            ('dr', 'NUMERIC'),
                            ('cr', 'NUMERIC'),
                            ('mv', 'NUMERIC'),
                            ('eb', 'NUMERIC'),
                            ('ji_date', 'DATE'),
                            ('ji_no', 'VARCHAR'),
                            ('ji_partner', 'VARCHAR'),
                            ('ji_remarks', 'VARCHAR')])
     create_composite_type(cr, 'gl_id_nth_row',
                           [('comparison_order', 'BIGINT'),
                            ('id', 'BIGINT'),
                            ('nth_row', 'BIGINT')])
     create_plpgsql_proc(cr, 'gl_decorator',
                         [('IN', 'axes_data_points', 'GL_AXES_DATA_POINT[]'),
                          ('IN', 'journal_items', 'GL_JOURNAL_ITEM[]')],
                         'SETOF GL_DECORATED_RECORD',
                         _GL_DECORATOR_DEF)
Example #10
0
 def _auto_init(self, cr, context=None):
     super(via_jasper_report, self)._auto_init(cr, context=context)
     create_plpgsql_proc(cr, 'gl_array_cat',
                         [('IN', 'array_1', 'BIGINT[]'),
                          ('IN', 'array_2', 'BIGINT[]')], 'BIGINT[]',
                         _GL_ARRAY_CAT_DEF)
     create_aggregator(cr, 'gl_array_reduce', 'BIGINT[]', {
         'sfunc': 'gl_array_cat',
         'stype': 'BIGINT[]'
     })
     create_composite_type(cr, 'gl_journal_item',
                           [('id', 'BIGINT'), ('date', 'DATE'),
                            ('no', 'VARCHAR'), ('partner', 'VARCHAR'),
                            ('remarks', 'VARCHAR'), ('debit', 'NUMERIC'),
                            ('credit', 'NUMERIC'),
                            ('top_level_debit', 'NUMERIC'),
                            ('top_level_credit', 'NUMERIC'),
                            ('comparison_order', 'BIGINT'),
                            ('com_id', 'BIGINT')])
     create_composite_type(cr, 'gl_axes_data_point',
                           [('decorator_bold', 'BOOLEAN'),
                            ('decorator_underline', 'BOOLEAN'),
                            ('decorator_italic', 'BOOLEAN'),
                            ('decorator_move_bold', 'BOOLEAN'),
                            ('decorator_move_underline', 'BOOLEAN'),
                            ('decorator_move_italic', 'BOOLEAN'),
                            ('decorator_blank_line', 'BOOLEAN'),
                            ('decorator_title_line', 'BOOLEAN'),
                            ('rtn_order', 'BIGINT'),
                            ('comparison_order', 'BIGINT'),
                            ('comparison_label', 'VARCHAR'),
                            ('com_order', 'BIGINT'), ('com_id', 'BIGINT'),
                            ('com_name', 'VARCHAR'),
                            ('rtn_name', 'VARCHAR'),
                            ('rtn_level', 'BIGINT'), ('bb', 'NUMERIC'),
                            ('dr', 'NUMERIC'), ('cr', 'NUMERIC'),
                            ('mv', 'NUMERIC'), ('eb', 'NUMERIC'),
                            ('move_lines_count', 'NUMERIC'),
                            ('move_lines', 'BIGINT[]')])
     create_composite_type(cr, 'gl_decorated_record',
                           [('decorator_header_band_selector', 'INT'),
                            ('decorator_band_selector', 'INT'),
                            ('decorator_bold', 'BOOLEAN'),
                            ('decorator_underline', 'BOOLEAN'),
                            ('decorator_italic', 'BOOLEAN'),
                            ('decorator_move_bold', 'BOOLEAN'),
                            ('decorator_move_underline', 'BOOLEAN'),
                            ('decorator_move_italic', 'BOOLEAN'),
                            ('decorator_blank_line', 'BOOLEAN'),
                            ('decorator_title_line', 'BOOLEAN'),
                            ('nth_row', 'BIGINT'),
                            ('comparison_order', 'BIGINT'),
                            ('comparison_label', 'VARCHAR'),
                            ('com_order', 'BIGINT'),
                            ('com_name', 'VARCHAR'),
                            ('rtn_name', 'VARCHAR'),
                            ('rtn_level', 'BIGINT'), ('bb', 'NUMERIC'),
                            ('dr', 'NUMERIC'), ('cr', 'NUMERIC'),
                            ('mv', 'NUMERIC'), ('eb', 'NUMERIC'),
                            ('ji_date', 'DATE'), ('ji_no', 'VARCHAR'),
                            ('ji_partner', 'VARCHAR'),
                            ('ji_remarks', 'VARCHAR')])
     create_composite_type(cr,
                           'gl_id_nth_row', [('comparison_order', 'BIGINT'),
                                             ('id', 'BIGINT'),
                                             ('nth_row', 'BIGINT')])
     create_plpgsql_proc(
         cr, 'gl_decorator',
         [('IN', 'axes_data_points', 'GL_AXES_DATA_POINT[]'),
          ('IN', 'journal_items', 'GL_JOURNAL_ITEM[]')],
         'SETOF GL_DECORATED_RECORD', _GL_DECORATOR_DEF)