[IMP] sale_order_batch: add reset to draft
This commit is contained in:
parent
3c1e6fcd72
commit
426d617446
7 changed files with 52 additions and 33 deletions
|
|
@ -34,16 +34,16 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
|
|||
Changelog
|
||||
=========
|
||||
|
||||
:0.0.1: Initial module.
|
||||
:1.0.0: Add Multi Company ability
|
||||
:1.0.1: rename product creation methode
|
||||
:1.1.0: Make validity_date persistent, add batches to SO views
|
||||
:1.1.1: Remove validity date
|
||||
:2.0.0: Move product logic to sale order lines
|
||||
:2.1.0: Add "In Progress" and "Cancelled" state
|
||||
:2.2.0: Add invoice status and menues
|
||||
:2.2.1: Add lst_price to view
|
||||
:2.2.2: store all quantities and round open values
|
||||
:16.0.0.0.1: Initial module.
|
||||
:16.0.0.1: Add Multi Company ability
|
||||
:16.0.0.2: rename product creation methode
|
||||
:16.0.0.3: Make validity_date persistent, add batches to SO views
|
||||
:16.0.0.4: Remove validity date
|
||||
:16.0.0.5: Move product logic to sale order lines
|
||||
:16.0.2.1.0: Add "In Progress" and "Cancelled" state
|
||||
:16.0.2.2.0: Add invoice status and menues
|
||||
:16.0.2.2.1: Add lst_price to view
|
||||
:16.0.2.3.0: Add "Reset to Open"
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"author": "BAKEUP",
|
||||
"website": "https://www.bakeup.org",
|
||||
"category": "Sale",
|
||||
"version": "16.0.2.2.2",
|
||||
"version": "16.0.2.3.0",
|
||||
"depends": ["sale", "product"],
|
||||
"data": [
|
||||
"data/ir_sequence_data.xml",
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ class SaleOrder(models.Model):
|
|||
|
||||
def action_add_to_batch(self):
|
||||
"""
|
||||
TODO: Add Wizard to choose between batches if more than one existis. Picking the first one for now.
|
||||
TODO: Add Wizard to choose between batches if more than one existis.
|
||||
Picking the first one for now.
|
||||
"""
|
||||
for sale_order in self:
|
||||
company = sale_order.company_id
|
||||
|
|
|
|||
|
|
@ -187,10 +187,19 @@ class SaleOrderBatch(models.Model):
|
|||
def action_cancel(self):
|
||||
for batch in self:
|
||||
orders = batch.sale_order_ids
|
||||
orders.action_cancel()
|
||||
# use _action_cancel to skip the wizzard
|
||||
# ToDo: Implement wizard logic
|
||||
orders._action_cancel()
|
||||
batch.update({"state": "cancel"})
|
||||
return True
|
||||
|
||||
def action_open(self):
|
||||
for batch in self:
|
||||
orders = batch.sale_order_ids
|
||||
orders.action_draft()
|
||||
batch.update({"state": "open"})
|
||||
return True
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
:0.0.1: Initial module.
|
||||
:1.0.0: Add Multi Company ability
|
||||
:1.0.1: rename product creation methode
|
||||
:1.1.0: Make validity_date persistent, add batches to SO views
|
||||
:1.1.1: Remove validity date
|
||||
:2.0.0: Move product logic to sale order lines
|
||||
:2.1.0: Add "In Progress" and "Cancelled" state
|
||||
:2.2.0: Add invoice status and menues
|
||||
:2.2.1: Add lst_price to view
|
||||
:2.2.2: store all quantities and round open values
|
||||
:16.0.0.0.1: Initial module.
|
||||
:16.0.0.1: Add Multi Company ability
|
||||
:16.0.0.2: rename product creation methode
|
||||
:16.0.0.3: Make validity_date persistent, add batches to SO views
|
||||
:16.0.0.4: Remove validity date
|
||||
:16.0.0.5: Move product logic to sale order lines
|
||||
:16.0.2.1.0: Add "In Progress" and "Cancelled" state
|
||||
:16.0.2.2.0: Add invoice status and menues
|
||||
:16.0.2.2.1: Add lst_price to view
|
||||
:16.0.2.3.0: Add "Reset to Open"
|
||||
|
|
@ -392,25 +392,25 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
|
|||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">0.0.1:</th><td class="field-body">Initial module.</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.0.1:</th><td class="field-body">Initial module.</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Add Multi Company ability</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.1:</th><td class="field-body">Add Multi Company ability</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">1.0.1:</th><td class="field-body">rename product creation methode</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.2:</th><td class="field-body">rename product creation methode</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Make validity_date persistent, add batches to SO views</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.3:</th><td class="field-body">Make validity_date persistent, add batches to SO views</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">1.1.1:</th><td class="field-body">Remove validity date</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.4:</th><td class="field-body">Remove validity date</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">2.0.0:</th><td class="field-body">Move product logic to sale order lines</td>
|
||||
<tr class="field"><th class="field-name">16.0.0.5:</th><td class="field-body">Move product logic to sale order lines</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">2.1.0:</th><td class="field-body">Add “In Progress” and “Cancelled” state</td>
|
||||
<tr class="field"><th class="field-name">16.0.2.1.0:</th><td class="field-body">Add “In Progress” and “Cancelled” state</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">2.2.0:</th><td class="field-body">Add invoice status and menues</td>
|
||||
<tr class="field"><th class="field-name">16.0.2.2.0:</th><td class="field-body">Add invoice status and menues</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">2.2.1:</th><td class="field-body">Add lst_price to view</td>
|
||||
<tr class="field"><th class="field-name">16.0.2.2.1:</th><td class="field-body">Add lst_price to view</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">2.2.2:</th><td class="field-body">store all quantities and round open values</td>
|
||||
<tr class="field"><th class="field-name">16.0.2.3.0:</th><td class="field-body">Add “Reset to Open”</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,15 @@
|
|||
type="object"
|
||||
attrs="{'invisible': [('state', 'not in',['open', 'in_progress','closed'])]}"
|
||||
/>
|
||||
<button
|
||||
name="action_open"
|
||||
id="action_open"
|
||||
data-hotkey="w"
|
||||
string="Set to Open"
|
||||
class="btn-primary"
|
||||
type="object"
|
||||
states="cancel"
|
||||
/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in a new issue