@waron97/prbot 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waron97/prbot",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -196,7 +196,8 @@ function appendRefsToLine(line, tridentIds, jiras) {
196
196
  const suffix = tridentIds.map((id) => `#${id}`).join(', ');
197
197
  const tridentMatch = result.match(/Trident (#[\d, #]+)/);
198
198
  if (tridentMatch) {
199
- result = result.replace(/Trident (#[\d, #]+)/, `Trident ${tridentMatch[1]}, ${suffix}`);
199
+ const existingTridents = tridentMatch[1].replace(/[,\s]+$/, '');
200
+ result = result.replace(/Trident (#[\d, #]+)/, `Trident ${existingTridents}, ${suffix}`);
200
201
  } else {
201
202
  const parenMatch = result.match(/\(([^)]*)\)\s*$/);
202
203
  if (parenMatch) {
@@ -206,7 +206,7 @@ async function exportEmailTemplates(opts) {
206
206
  const migrationDir = path.join(ADDONS_PATH, 'config', module, 'migrations', version);
207
207
  preMigratePath = path.join(migrationDir, 'pre-migrate.py');
208
208
  await fs.mkdir(migrationDir, { recursive: true });
209
- await fs.writeFile(preMigratePath, generateEmailPreMigrateScript(renames));
209
+ await fs.writeFile(preMigratePath, generateEmailPreMigrateScript(renames, module));
210
210
  log(`Wrote pre-migrate: ${preMigratePath}`);
211
211
  }
212
212
  }
@@ -175,7 +175,7 @@ function detectEmailRenames(oldMap, newMap) {
175
175
  return renames;
176
176
  }
177
177
 
178
- function generateEmailPreMigrateScript(renames) {
178
+ function generateEmailPreMigrateScript(renames, module) {
179
179
  const lines = [
180
180
  '# Copyright 2025-TODAY Symphonie Prime S.r.l. (www.symphonieprime.com)',
181
181
  '# All rights reserved.',
@@ -196,8 +196,8 @@ function generateEmailPreMigrateScript(renames) {
196
196
  ' ]',
197
197
  ' for old_name, new_name in renames:',
198
198
  ' env.cr.execute(',
199
- ' "UPDATE ir_model_data SET name = %s WHERE name = %s AND model = %s",',
200
- ' (new_name, old_name, "mail.template"),',
199
+ ` "UPDATE ir_model_data SET name = %s WHERE name = %s AND model = %s AND module = %s",`,
200
+ ` (new_name, old_name, "mail.template", "${module}"),`,
201
201
  ' )',
202
202
  );
203
203