Skip to content

Commit

Permalink
Merge pull request #708 from Som-Energia/new_soci_campaign
Browse files Browse the repository at this point in the history
new soci campaign and tag
  • Loading branch information
pauboixsom authored Aug 13, 2024
2 parents 6434cc0 + 344aed3 commit 5243709
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions som_polissa_soci/__terp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"wizard/wizard_subscribe_client_mailchimp.xml",
"wizard/wizard_subscribe_soci_mailchimp.xml",
"wizard/wizard_unsubscribe_soci_mailchimp.xml",
"somenergia_soci_data.xml",
],
"active": False,
"installable": True,
Expand Down
5 changes: 5 additions & 0 deletions som_polissa_soci/giscedata_polissa_category_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@
<field name="parent_id" ref="cat_1"/>
<field name="active">True</field>
</record>
<record model="giscedata.polissa.category" id="origen_ct_sense_socia_category">
<field name="name">Origen vinculat al CT sense sòcia</field>
<field name="complete_name">Origen vinculat al CT sense sòcia</field>
<field name="active">True</field>
</record>
</data>
</openerp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
import logging
from oopgrade.oopgrade import load_data_records, load_data


def up(cursor, installed_version):
if not installed_version:
return

logger = logging.getLogger('openerp.migration')

logger.info("Updating soci and category CT campaign")
data_records = ["origen_ct_sense_socia_category"]
load_data_records(
cursor, 'som_polissa_soci', 'giscedata_polissa_category_data.xml', data_records,
mode='update'
)
load_data(
cursor, 'som_polissa_soci', 'somenergia_soci_data.xml', mode='init'
)
logger.info("XMLs succesfully updated.")


def down(cursor, installed_version):
pass


migrate = up
15 changes: 15 additions & 0 deletions som_polissa_soci/somenergia_soci_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<data>
<!-- Partner -->
<record id="res_partner_soci_ct" model="res.partner">
<field name="name">Campanya de facilitació del CT sense sòcia</field>
<field name="ref">S999998</field>
<field name="vat">ES99999998T</field>
</record>
<!-- Soci -->
<record id="soci_ct_sense_soci" model="somenergia.soci">
<field name="partner_id" ref="res_partner_soci_ct"/>
</record>
</data>
</openerp>

0 comments on commit 5243709

Please sign in to comment.