Skip to content

Commit dc9ee7c

Browse files
authored
OdooUtils/OdooHandler: remove disfunctional addChatterMessage (OpenEMS#2427)
1 parent ccc434e commit dc9ee7c

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

io.openems.backend.metadata.odoo/src/io/openems/backend/metadata/odoo/odoo/OdooHandler.java

-16
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,6 @@ public void writeEdgeUser(EdgeUser edgeUser, FieldValue<?>... fieldValues) {
9696
}
9797
}
9898

99-
/**
100-
* Adds a message in Odoo Chatter ('mail.thread').
101-
*
102-
* @param edge the Edge
103-
* @param message the message
104-
*/
105-
public void addChatterMessage(MyEdge edge, String message) {
106-
try {
107-
OdooUtils.addChatterMessage(this.credentials, Field.EdgeDevice.ODOO_MODEL, edge.getOdooId(), message);
108-
} catch (OpenemsException e) {
109-
this.parent.logError(this.log, "Unable to add Chatter Message to Edge [" + edge.getId() + "] " //
110-
+ "Message [" + message + "]" //
111-
+ ": " + e.getMessage());
112-
}
113-
}
114-
11599
/**
116100
* Returns Edge by setupPassword, otherwise an empty {@link Optional}.
117101
*

io.openems.backend.metadata.odoo/src/io/openems/backend/metadata/odoo/odoo/OdooUtils.java

-22
Original file line numberDiff line numberDiff line change
@@ -426,28 +426,6 @@ protected static int getObjectReference(Credentials credentials, String module,
426426
}
427427
}
428428

429-
/**
430-
* Adds a message in Odoo Chatter ('mail.thread').
431-
*
432-
* @param credentials the Odoo credentials
433-
* @param model Odoo model (e.g. 'res.partner')
434-
* @param id id of model
435-
* @param message the message
436-
* @throws OpenemsException on error
437-
*/
438-
protected static void addChatterMessage(Credentials credentials, String model, int id, String message)
439-
throws OpenemsException {
440-
try {
441-
// Execute XML request
442-
var resultObj = executeKw(credentials, model, "message_post", new Object[] { id, message });
443-
if (resultObj == null) {
444-
throw new OpenemsException("Returned Null");
445-
}
446-
} catch (Throwable e) {
447-
throw new OpenemsException("Unable to write to Odoo: " + e.getMessage());
448-
}
449-
}
450-
451429
/**
452430
* Create a record in Odoo.
453431
*

0 commit comments

Comments
 (0)