Debug v17

This commit is contained in:
Laurent Destailleur 2023-03-01 12:34:01 +01:00
parent 93953cd24c
commit f740a039f7
2 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,7 @@ ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_percent (percent);
UPDATE llx_c_paiement SET code = 'BANCON' WHERE code = 'BAN' AND libelle = 'Bancontact';
ALTER TABLE llx_partnership DROP FOREIGN KEY llx_partnership_fk_user_creat;
-- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN fk_user_creat integer NULL;
-- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN fk_user_creat DROP NOT NULL;

View File

@ -550,10 +550,15 @@ class Partnership extends CommonObject
*/
public function update(User $user, $notrigger = false)
{
global $user;
if ($this->fk_soc <= 0 && $this->fk_member <= 0) {
$this->error[] = "ErrorThirpdartyOrMemberidIsMandatory";
return -1;
}
if (empty($this->fk_user_creat)) { // Fot the case the object was created with empty user.
$this->fk_user_creat = $user->id;
}
return $this->updateCommon($user, $notrigger);
}