Skip to content

Commit a468514

Browse files
[ADD] sale_insurance_caser
TT58928
1 parent 016933d commit a468514

28 files changed

Lines changed: 3497 additions & 0 deletions

sale_insurance_caser/README.rst

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
====================
2+
Sale Insurance Caser
3+
====================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:5d433c1f9a68d1f54572257e55e996770c68c203f7abe56f4bfd2d8f26296259
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
20+
:target: https://github.com/OCA/l10n-spain/tree/18.0/sale_insurance_caser
21+
:alt: OCA/l10n-spain
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-sale_insurance_caser
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Integration module with Caser insurance API to automate insurance policy
32+
issuance for electronic device sales.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Configuration
40+
=============
41+
42+
Go to *Settings > Sales > Caser Insurance* and configure:
43+
44+
1. **Caser Production Environment**: Enable for production, disable for
45+
test environment
46+
2. **Caser Web Username**: Your Caser API username
47+
3. **Caser Agency Code**: Your agency code (e.g., "9999")
48+
4. **Caser Agent Code**: Your agent code (e.g., "9999999")
49+
5. **Caser SICA Code**: Your SICA code (e.g., "9999")
50+
51+
Usage
52+
=====
53+
54+
Tarification (Get Insurance Prices)
55+
-----------------------------------
56+
57+
1. Go to *Settings > Sales > Caser Insurance*
58+
2. Click on **Configure Price Ranges** button
59+
3. Select one or more price ranges and click **Get Prices from Caser**
60+
button (or use *Action > Get Tarification Prices*)
61+
4. Insurance products will be created/updated automatically with prices
62+
from Caser API
63+
64+
Sale Order Flow
65+
---------------
66+
67+
Step 1: Create Sale Order
68+
~~~~~~~~~~~~~~~~~~~~~~~~~
69+
70+
1. Create a sale order with products that support insurance
71+
2. In each order line, set **Quantity to Insure** field
72+
3. Insurance lines are automatically created based on price ranges
73+
74+
Step 2: Validate Delivery
75+
~~~~~~~~~~~~~~~~~~~~~~~~~
76+
77+
1. Confirm the sale order
78+
2. In the delivery order, assign serial numbers to products
79+
3. Click **Validate**
80+
4. Insurance requests are sent to Caser asynchronously via queue jobs
81+
82+
Step 3: Review Insurance Status
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+
85+
After validation, check the insurance lines in the sale order:
86+
87+
- **Is Caser Insurance**: Identifies insurance product lines
88+
- **Insured Lot**: The serial number that was insured
89+
- **Policy Number**: Caser policy number (if successful)
90+
- **Insurance Price**: Final price charged by Caser
91+
- **Error Message**: Any error from Caser API (if failed)
92+
93+
Viewing Request/Response Logs
94+
-----------------------------
95+
96+
To inspect the XML communication with Caser:
97+
98+
1. Open the sale order
99+
2. Click on an insurance line (where **Is Caser Insurance** = True)
100+
3. Go to the **Caser** tab to view:
101+
102+
- **Request XML**: Complete SOAP request sent to Caser
103+
- **Response XML**: Complete response received from Caser
104+
105+
Bug Tracker
106+
===========
107+
108+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
109+
In case of trouble, please check there if your issue has already been reported.
110+
If you spotted it first, help us to smash it by providing a detailed and welcomed
111+
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20sale_insurance_caser%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
112+
113+
Do not contact contributors directly about support or help with technical issues.
114+
115+
Credits
116+
=======
117+
118+
Authors
119+
-------
120+
121+
* Tecnativa
122+
123+
Contributors
124+
------------
125+
126+
- `Tecnativa <https://www.tecnativa.com>`__:
127+
128+
- Juan Carlos Oñate
129+
130+
Maintainers
131+
-----------
132+
133+
This module is maintained by the OCA.
134+
135+
.. image:: https://odoo-community.org/logo.png
136+
:alt: Odoo Community Association
137+
:target: https://odoo-community.org
138+
139+
OCA, or the Odoo Community Association, is a nonprofit organization whose
140+
mission is to support the collaborative development of Odoo features and
141+
promote its widespread use.
142+
143+
.. |maintainer-juancarlosonate-tecnativa| image:: https://github.com/juancarlosonate-tecnativa.png?size=40px
144+
:target: https://github.com/juancarlosonate-tecnativa
145+
:alt: juancarlosonate-tecnativa
146+
147+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
148+
149+
|maintainer-juancarlosonate-tecnativa|
150+
151+
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/18.0/sale_insurance_caser>`_ project on GitHub.
152+
153+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sale_insurance_caser/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 Juan Carlos Oñate - Tecnativa <juancarlos.onate@tecnativa.com>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
{
4+
"name": "Sale Insurance Caser",
5+
"summary": "Automate insurance policy request with Caser",
6+
"version": "18.0.1.0.0",
7+
"category": "Sales/Sales",
8+
"author": "Tecnativa, Odoo Community Association (OCA)",
9+
"maintainers": ["juancarlosonate-tecnativa"],
10+
"website": "https://github.com/OCA/l10n-spain",
11+
"license": "AGPL-3",
12+
"installable": True,
13+
"depends": [
14+
"sale_stock",
15+
"queue_job",
16+
"product_brand",
17+
],
18+
"data": [
19+
"security/ir.model.access.csv",
20+
"data/queue_job_channel_data.xml",
21+
"data/caser_price_range_data.xml",
22+
"data/ir_actions_server.xml",
23+
"views/caser_price_range_views.xml",
24+
"views/res_config_settings_views.xml",
25+
"views/sale_order_views.xml",
26+
"views/product_category_views.xml",
27+
],
28+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="caser_price_range_1" model="caser.price.range">
4+
<field name="min_price">95.00</field>
5+
<field name="max_price">250.00</field>
6+
<field name="code">1</field>
7+
<field name="insurance_price_notax">29.55</field>
8+
<field name="insurance_price">31.95</field>
9+
</record>
10+
<record id="caser_price_range_2" model="caser.price.range">
11+
<field name="min_price">250.01</field>
12+
<field name="max_price">300.00</field>
13+
<field name="code">2</field>
14+
<field name="insurance_price_notax">35.71</field>
15+
<field name="insurance_price">38.62</field>
16+
</record>
17+
<record id="caser_price_range_3" model="caser.price.range">
18+
<field name="min_price">300.01</field>
19+
<field name="max_price">400.00</field>
20+
<field name="code">3</field>
21+
<field name="insurance_price_notax">39.40</field>
22+
<field name="insurance_price">42.61</field>
23+
</record>
24+
<record id="caser_price_range_4" model="caser.price.range">
25+
<field name="min_price">400.01</field>
26+
<field name="max_price">550.00</field>
27+
<field name="code">4</field>
28+
<field name="insurance_price_notax">57.09</field>
29+
<field name="insurance_price">61.75</field>
30+
</record>
31+
<record id="caser_price_range_5" model="caser.price.range">
32+
<field name="min_price">550.01</field>
33+
<field name="max_price">750.00</field>
34+
<field name="code">5</field>
35+
<field name="insurance_price_notax">70.52</field>
36+
<field name="insurance_price">76.27</field>
37+
</record>
38+
<record id="caser_price_range_6" model="caser.price.range">
39+
<field name="min_price">750.01</field>
40+
<field name="max_price">850.00</field>
41+
<field name="code">6</field>
42+
<field name="insurance_price_notax">87.95</field>
43+
<field name="insurance_price">95.12</field>
44+
</record>
45+
<record id="caser_price_range_7" model="caser.price.range">
46+
<field name="min_price">850.01</field>
47+
<field name="max_price">1000.00</field>
48+
<field name="code">7</field>
49+
<field name="insurance_price_notax">95.90</field>
50+
<field name="insurance_price">103.71</field>
51+
</record>
52+
<record id="caser_price_range_8" model="caser.price.range">
53+
<field name="min_price">1000.01</field>
54+
<field name="max_price">1400.00</field>
55+
<field name="code">8</field>
56+
<field name="insurance_price_notax">141.23</field>
57+
<field name="insurance_price">152.74</field>
58+
</record>
59+
<record id="caser_price_range_9" model="caser.price.range">
60+
<field name="min_price">1400.01</field>
61+
<field name="max_price">1700.00</field>
62+
<field name="code">9</field>
63+
<field name="insurance_price_notax">158.17</field>
64+
<field name="insurance_price">171.06</field>
65+
</record>
66+
<record id="caser_price_range_10" model="caser.price.range">
67+
<field name="min_price">1700.01</field>
68+
<field name="max_price">2000.00</field>
69+
<field name="code">10</field>
70+
<field name="insurance_price_notax">185.07</field>
71+
<field name="insurance_price">200.16</field>
72+
</record>
73+
<record id="caser_price_range_11" model="caser.price.range">
74+
<field name="min_price">2000.01</field>
75+
<field name="max_price">2200.00</field>
76+
<field name="code">11</field>
77+
<field name="insurance_price_notax">223.93</field>
78+
<field name="insurance_price">242.18</field>
79+
</record>
80+
<record id="caser_price_range_12" model="caser.price.range">
81+
<field name="min_price">2200.01</field>
82+
<field name="max_price">2600.00</field>
83+
<field name="code">12</field>
84+
<field name="insurance_price_notax">274.47</field>
85+
<field name="insurance_price">296.84</field>
86+
</record>
87+
</odoo>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="action_server_update_all_caser_prices" model="ir.actions.server">
4+
<field name="name">Update All Caser Insurance Prices</field>
5+
<field name="model_id" ref="model_caser_price_range" />
6+
<field name="binding_model_id" ref="model_caser_price_range" />
7+
<field name="binding_view_types">list</field>
8+
<field name="state">code</field>
9+
<field name="code">
10+
action = env['caser.price.range'].search([]).action_get_tarification_prices()
11+
</field>
12+
</record>
13+
</odoo>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="channel_caser" model="queue.job.channel">
4+
<field name="name">caser</field>
5+
<field name="parent_id" ref="queue_job.channel_root" />
6+
</record>
7+
</odoo>

0 commit comments

Comments
 (0)