Work on MRP cration

This commit is contained in:
Laurent Destailleur 2019-12-02 15:23:21 +01:00
parent 92070fa491
commit 310e65b93c
2 changed files with 15 additions and 3 deletions

View File

@ -231,7 +231,19 @@ class Mo extends CommonObject
*/
public function create(User $user, $notrigger = false)
{
return $this->createCommon($user, $notrigger);
$this->db->begin();
$result = $this->createCommon($user, $notrigger);
// Insert lines in mrp_production table
if ($result > 0) {
$this->db->commit();
} else {
$this->db->rollback();
}
return $result;
}
/**

View File

@ -30,8 +30,8 @@ if (empty($conf) || ! is_object($conf))
print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">';
print '<td>'.$this->tpl['label'].'</td>';
print '<td class="right">'.$this->tpl['qty'].'</td>';
print '<td class="center">'.yn($this->tpl['qty_frozen']).'</td>';
print '<td class="center">'.yn($this->tpl['disable_stock_change']).'</td>';
print '<td class="center">'.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').'</td>';
print '<td class="center">'.($this->tpl['disable_stock_change'] ? yn($this->tpl['disable_stock_change']) : '').'</td>';
//print '<td class="right">'.$this->tpl['efficiency'].'</td>';
$selected=1;