Unable to upack ISO 8583 F137 using JPOS - iso8583

I'm trying to introduce F137 to my ISO 8583 processing. I'm using following xml configurations in packing and unpacking the ISO message for f137.
<isofield
id="137"
length="2"
name="Application Transaction Counter"
class="org.jpos.iso.IFB_BINARY"/>
I'm able to pack the F137 where I'm able to see F137 in outgoing message,
<send>
<isomsg direction="outgoing">
<header>16010201E10000000000000000000000000000000000</header>
<field id="0" value="0210"/>
<field id="2" value="933456______7663"/>
<field id="4" value="000000000200"/>
<field id="7" value="0906144357"/>
<field id="11" value="123456"/>
<field id="12" value="144357"/>
<field id="13" value="0906"/>
<field id="18" value="6012"/>
<field id="19" value="356"/>
<field id="22" value="0911"/>
<field id="25" value="59"/>
<field id="28" value=" 5 "/>
<field id="32" value="441370"/>
<field id="37" value="727523083909"/>
<field id="38" value="231043"/>
<field id="39" value="00"/>
<field id="41" value=" 101"/>
<field id="42" value="CA-IDCode-77765"/>
<isomsg id="43">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="1" value="Acceptor 11 "/>
<field id="2" value="NW "/>
<field id="3" value="IN"/>
</isomsg>
<isomsg id="44">
<field id="15" value="4233"/>
</isomsg>
<field id="48" value=" 3"/>
<field id="49" value="356"/>
<field id="55" value="AA55AA55" type="binary"/>
<field id="59" value="CA123700052"/>
<field id="60" value="9100F0000500" type="binary"/>
<isomsg id="62">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="1" value="1"/>
<field id="2" value="153621623779500"/>
<field id="7" value="11234123412341234123412345"/>
<field id="20" value="0000909090"/>
</isomsg>
<isomsg id="63">
<!-- org.jpos.iso.packager.Base1SubFieldPackager -->
<field id="13" value="02F0F0"/>
<field id="19" value="210"/>
</isomsg>
<field id="102" value="00023830"/>
<field id="104" value="5700040102D7D75F00761006F0F6F5F4F3F40105F1F2F3F4F50210F6F5F4F3F2F1F0F0F0F0F3F3F4F2F3F3030997998182A4848488810404A385A2A30509A289958781979699850602E2D50709A289958781979699850802F0F10A0ED985838997898595A340D58194850C09A289958781979699850D09A28995878197969985" type="dataset" />
<field id="119" value="35623"/>
<!-- 123{ 68{02:10, 03:12321232123, 04:123412341}} -->
<field id="123" value="68001C0202F1F0030BF1F2F3F2F1F2F3F2F1F2F30409F1F2F3F4F1F2F3F4F1" type="dataset" />
**<field id="137" value="1232" type="binary"/>**
</isomsg>
</send>
but during unpacking jpos throws following exception.
<session-error>
<iso-exception>
org.jpos.iso.IFB_LLHNUM: Problem unpacking field 32 (org.jpos.iso.ISOException: Field length 96 too long. Max: 11) unpacking field=32, consumed=54
org.jpos.iso.ISOException: org.jpos.iso.IFB_LLHNUM: Problem unpacking field 32 (org.jpos.iso.ISOException: Field length 96 too long. Max: 11) unpacking field=32, consumed=54
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:265)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:420)
at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:924)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:692)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:155)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:72)
</iso-exception>
Does JPOS support fields greater than F128. Btw Application works properly without F137.

ISO-8583 defines 128 fields. Systems that use fields beyond 128 are quite unusual, and weird (I see this sample message seems to come from Bhutan). That said, jPOS supports them.
I suggest you search the jPOS forum for the keyword 'tertiary bitmap':
https://groups.google.com/forum/#!searchin/jpos-users/tertiary$20bitmap%7Csort:date

Related

Format to xml view in odoo

I would like to give this structure to new fields that I add to this (inherited) view.
This is the xml code that I am using:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record id="fleet_vehicule_l10n_new_form"
model="ir.ui.view">
<field name="name">fleet.vehicle.l10n.new.form</field>
<field name="model">fleet.vehicle</field>
<field name="inherit_id"
ref="fleet.fleet_vehicle_view_form" />
<field name="arch"
type="xml">
<field name="model_id"
position="after">
<group >
<field name="vehiculo_sat" />
</group>
</field>
<field name="description"
position="after">
<group string="MX EDI group">
<field name="transport_permit_no" />
<field name="transport_insurer" />
<field name="transport_insurance_policy" />
<field name="transport_perm_sct" />
<field name="vehicle_model" />
<field name="vehicle_config" />
<field name="vehicle_licence" />
<field name="trailer_ids" />
<field name="figure_ids" />
</group>
</field>
</field>
</record>
</data>
</odoo>
How can I achieve this? I understand that odoo uses bootstrap, but I don't know how to apply the classes in the xml of an inherited view.
Edit
I try this, but still not working:
<field name="description" position="after">
<!-- <field name="vehicle_licence" />
<field name="vehicle_model" /> -->
<group>
<field name="transport_permit_no" />
<field name="transport_insurer" />
<field name="transport_insurance_policy" />
<field name="transport_perm_sct" />
</group>
<field name="vehicle_config" />
<group>
<field name="trailer_ids" />
</group>
<group>
<field name="figure_ids" />
</group>
</field>
What am I doing wrong?
The description filed is inside a group, so adding two groups inside a group won't work like in the picture above.
You can add the group to sheet like following:
<xpath expr="//sheet" position="inside">
<group>
<group string="MX EDI group">
<field name="transport_permit_no"/>
<field name="transport_insurer"/>
<field name="transport_insurance_policy"/>
<field name="transport_perm_sct"/>
<field name="vehicle_model"/>
<field name="vehicle_config"/>
<field name="vehicle_licence"/>
</group>
<group string="Second Group">
</group>
</group>
<group>
<field name="trailer_ids"/>
<field name="figure_ids"/>
</group>
</xpath>
The default fleet vehicle form added six groups inside a group, so you can append the two groups inside that group
Example:
<xpath expr="//sheet/group" position="inside">
<group string="MX EDI group">
<field name="transport_permit_no"/>
<field name="transport_insurer"/>
<field name="transport_insurance_policy"/>
<field name="transport_perm_sct"/>
<field name="vehicle_model"/>
<field name="vehicle_config"/>
<field name="vehicle_licence"/>
</group>
<group string="Second Group">
</group>
</xpath>
<xpath expr="//sheet/group" position="after">
<group>
<field name="trailer_ids"/>
<field name="figure_ids"/>
</group>
</xpath>
The default col attribute value for group is 2

Create cron task in Odoo13

I am working on a new module in Odoo13CE and trying to create a scheduled task with the code:
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="electricity_charges_cron" model="ir.cron">
<field name="name">Get electricity charges</field>
<field name="model_id" ref="electricity_charges.model_electricity_charges_readings"/>
<field name="active" eval="True" />
<field name="state">code</field>
<field name="code">model.set_readings()</field>
<field name="interval_number">6</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="active" eval="False" />
<field name="doall" eval="True" />
<field name="user_id" ref="base.user_root" />
</record>
</data>
</odoo>
But when install or update the module this error appears:
odoo.tools.convert.ParseError: "null value in column "activity_user_type" violates not-null constraint
Any idea how I can resolve this error? Have the mail module installed.

Odoo - How to update non updateable records by XML

I have created a few companies under res.company
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="True">
<record id="partner_my_company_hk" model="res.partner" context="{'default_is_company': True}">
<field name="name">My company HK</field>
<field name="company_id" eval="None"/>
<field name="customer" eval="False"/>
<field name="is_company" eval="True"/>
<field name="street"></field>
<field name="city"></field>
<field name="zip"></field>
<field name="phone"></field>
<field name="email">info#my_company.com</field>
<field name="website">www.my_company.com</field>
<field name="image" type="base64" file="base/static/img/res_company_logo.png"/>
</record>
<record id="partner_my_company_us" model="res.partner">
<field name="name">My company US</field>
<field name="company_id" eval="None"/>
<field name="customer" eval="False"/>
<field name="is_company" eval="True"/>
<field name="street"></field>
<field name="city"></field>
<field name="zip"></field>
<field name="phone"></field>
<field name="email">info#my_company.com</field>
<field name="website">www.my_company.com</field>
<field name="image" type="base64" file="base/static/img/res_company_logo.png"/>
</record>
<record id="company_my_company_hk" model="res.company">
<field name="name">My company HK</field>
<field name="partner_id" ref="partner_my_company_hk"/>
<field name="currency_id" ref="base.USD"/>
</record>
<record id="partner_my_company_hk" model="res.partner">
<field name="company_id" ref="company_my_company_hk"/>
</record>
<record id="company_my_company_us" model="res.company">
<field name="name">My company US</field>
<field name="partner_id" ref="partner_my_company_us"/>
<field name="currency_id" ref="base.USD"/>
</record>
<record id="partner_my_company_us" model="res.partner">
<field name="company_id" ref="company_my_company_us"/>
</record>
</data>
</odoo>
This is my original res_users.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record id="base.user_admin" model="res.users">
<field name="groups_id" eval="[(4, ref('account.group_account_user'))]"/>
</record>
</data>
</odoo>
So I want to set those 2 newly created 2 companies into base.user_admin
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record id="base.user_admin" model="res.users">
<field name="groups_id" eval="[(4, ref('account.group_account_user'))]"/>
<field name="company_id" ref="company_my_company_hk" />
<field name="company_ids" eval="[(4, ref('company_my_company_hk')),(4, ref('company_my_company_us'))]" />
</record>
</data>
</odoo>
And it is not working. But when I uninstall the module and reinstall it works.
Why? I cannot uninstall the module just to make it work in the future. What are the limitations and how to bypass the limits?
You can change the noupdate value on XML, change the desired fields and should take the change on noupdate back.
<!-- Allow updating on noupdate=True records -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value
eval="[('module', '=', 'base'), ('name', '=', 'user_admin')]" />
</function>
<value eval="{'noupdate': False}" />
</function>
<record id="base.user_admin" model="res.users">
<!-- change fields here -->
</record>
<!-- Revoke noupdate change -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value
eval="[('module', '=', 'base'), ('name', '=', 'user_admin')]" />
</function>
<value eval="{'noupdate': True}" />
</function>
External ID user_admin in base has been marked as noupdate.
And noupdate cannot be overridden.
Unless I run
UPDATE ir_model_data SET noupdate=False WHERE name = 'user_admin' and module='base';
Otherwise I won't be able to update it when I upgrade the module
More refined solution to #CZoellner 's solution is:
<function name="toggle_noupdate" model="ir.model.data" eval="['res.users', ref('base.user_admin')]"/>

Logout when print Qweb report

How can I close the odoo session after printing a qweb report?
What I want is to close session after clicking Sample Report
<?xml version="1.0"?>
<odoo>
<record id="paperformat_euro_landscape"
model="report.paperformat">
<field name="name">European A4 Landscape</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Landscape</field>
<field name="margin_top">35</field>
<field name="margin_bottom">15</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False" />
<field name="header_spacing">35</field>
<field name="dpi">90</field>
</record>
<report id="action_mantto_task_report"
string="Sample Report"
model="rep.oper"
report_type="qweb-pdf"
name="repop_report.report_repop_task_template"
paperformat="paperformat_euro_landscape"
/>
</template>
</odoo>

Odoo Breadcrumb on form view

I have a form view and the breadcrumb is reading False. i am not sure where to set this but I would like the Partners name instead of False.
Below is my form view
<record id="view_ds_repair_form" model="ir.ui.view">
<field name="name">ds.repair.form</field>
<field name="model">ds.repair</field>
<field name="arch" type="xml">
<form string="Repairs">
<sheet>
<label for="name" class="oe_edit_only"/>
<group>
<group>
<field name="x_partner_id" placeholder="Customer Name"/>
<field name="computer_make"/>
<field name="password" />
<field name="items" widget="many2many_tags"/>
</group>
<group>
<field name="create_date"/>
<field name="status" />
<field name="priority"/>
<field name="estimatedrepair_cost"/>
</group>
</group>
It seems name field or rec_name field value is empty. So you have to provide value of it. Afterwards, it will display correct information.