Rename 'done' buttons to 'do' and label them as "Complete"

Closes #13039
This commit is contained in:
Cédric Krier
2024-02-17 17:50:49 +01:00
parent 254e72b074
commit 8666e82b80
85 changed files with 227 additions and 198 deletions
+1
View File
@@ -1,3 +1,4 @@
* Rename 'done' button to 'do'
* Add location name fields to move
* Unify shipment assignation scheduled jobs
* Fill shipment number only in waiting state
+12 -12
View File
@@ -477,7 +477,7 @@ class ShipmentIn(
'invisible': Eval('state') != 'draft',
'depends': ['state'],
},
'done': {
'do': {
'invisible': Eval('state') != 'received',
'depends': ['state'],
},
@@ -730,13 +730,13 @@ class ShipmentIn(
to_do = [s for s in shipments
if s.warehouse_storage == s.warehouse_input]
if to_do:
cls.done(to_do)
cls.do(to_do)
@classmethod
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
def do(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
@@ -898,7 +898,7 @@ class ShipmentInReturn(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
'tryton-back', 'tryton-forward'),
'depends': ['state'],
},
'done': {
'do': {
'invisible': Eval('state') != 'assigned',
'depends': ['state'],
},
@@ -1045,7 +1045,7 @@ class ShipmentInReturn(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
def do(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
@@ -1349,7 +1349,7 @@ class ShipmentOut(
'depends': [
'state', 'warehouse_storage', 'warehouse_output'],
},
'done': {
'do': {
'invisible': Eval('state') != 'packed',
},
'assign_wizard': {
@@ -1682,7 +1682,7 @@ class ShipmentOut(
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
def do(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
@@ -1989,7 +1989,7 @@ class ShipmentOutReturn(
'invisible': Eval('state') != 'draft',
'depends': ['state'],
},
'done': {
'do': {
'invisible': Eval('state') != 'received',
'depends': ['state'],
},
@@ -2185,13 +2185,13 @@ class ShipmentOutReturn(
to_do = [s for s in shipments
if s.warehouse_storage == s.warehouse_input]
if to_do:
cls.done(to_do)
cls.do(to_do)
@classmethod
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
def do(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
@@ -2496,7 +2496,7 @@ class ShipmentInternal(
| ~Eval('transit_location')),
'depends': ['state', 'transit_location'],
},
'done': {
'do': {
'invisible': If(
~Eval('transit_location'),
Eval('state') != 'assigned',
@@ -2844,7 +2844,7 @@ class ShipmentInternal(
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
def do(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
+10 -10
View File
@@ -569,8 +569,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.model.button" id="shipment_in_done_button">
<field name="model">stock.shipment.in</field>
<field name="name">done</field>
<field name="string">Done</field>
<field name="name">do</field>
<field name="string">Complete</field>
</record>
<record model="ir.model.access" id="access_shipment_out">
@@ -630,8 +630,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.model.button" id="shipment_out_done_button">
<field name="model">stock.shipment.out</field>
<field name="name">done</field>
<field name="string">Done</field>
<field name="name">do</field>
<field name="string">Complete</field>
<field name="confirm">Are you sure you want to complete the shipment?</field>
</record>
@@ -701,8 +701,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.model.button" id="shipment_internal_done_button">
<field name="model">stock.shipment.internal</field>
<field name="name">done</field>
<field name="string">Done</field>
<field name="name">do</field>
<field name="string">Complete</field>
</record>
<record model="ir.model.button" id="shipment_internal_assign_try_button">
@@ -784,8 +784,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.model.button" id="shipment_out_return_done_button">
<field name="model">stock.shipment.out.return</field>
<field name="name">done</field>
<field name="string">Done</field>
<field name="name">do</field>
<field name="string">Complete</field>
</record>
<record model="ir.model.access" id="access_shipment_in_return">
@@ -833,8 +833,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.model.button" id="shipment_in_return_done_button">
<field name="model">stock.shipment.in.return</field>
<field name="name">done</field>
<field name="string">Done</field>
<field name="name">do</field>
<field name="string">Complete</field>
<field name="confirm">Are you sure you want to complete the shipment?</field>
</record>
@@ -78,7 +78,7 @@ Receive a bunch of products::
>>> move.currency = company.currency
>>> shipment_in.save()
>>> shipment_in.click('receive')
>>> shipment_in.click('done')
>>> shipment_in.click('do')
Testing the report::
@@ -114,7 +114,7 @@ Add two shipment lines of same product and go through the workflow::
>>> shipment_out.click('assign_try')
>>> shipment_out.click('pick')
>>> shipment_out.click('pack')
>>> shipment_out.click('done')
>>> shipment_out.click('do')
Testing the reports::
@@ -152,7 +152,7 @@ Create an internal shipment::
>>> shipment_internal.save()
>>> shipment_internal.click('wait')
>>> shipment_internal.click('assign_try')
>>> shipment_internal.click('done')
>>> shipment_internal.click('do')
Testing the report::
@@ -83,7 +83,7 @@ Change inventory quantity and try to finish::
>>> inventory_move, = shipment.inventory_moves
>>> inventory_move.quantity = 11
>>> shipment.click('done')
>>> shipment.click('do')
Traceback (most recent call last):
...
ShipmentCheckQuantityWarning: ...
@@ -100,7 +100,7 @@ Add extra product to inventory and try to finish::
>>> move.quantity = 1
>>> move.from_location = input_loc
>>> move.to_location = storage_loc
>>> shipment.click('done')
>>> shipment.click('do')
Traceback (most recent call last):
...
ShipmentCheckQuantityWarning: ...
@@ -110,7 +110,7 @@ Add extra product to inventory and try to finish::
Finish the shipment::
>>> shipment.click('done')
>>> shipment.click('do')
>>> shipment.state
'done'
>>> len(shipment.incoming_moves)
@@ -119,7 +119,7 @@ Create Internal Shipment from lost_found location::
>>> lost_found_shipment.click('assign_try')
>>> lost_found_shipment.state
'assigned'
>>> lost_found_shipment.click('done')
>>> lost_found_shipment.click('do')
>>> lost_found_shipment.state
'done'
@@ -129,7 +129,7 @@ Check that now we can finish the older shipment::
>>> assertEqual(shipment.assigned_by, employee)
>>> shipment.done_by
>>> shipment.click('done')
>>> shipment.click('do')
>>> shipment.state
'done'
>>> assertEqual(shipment.done_by, employee)
@@ -96,7 +96,7 @@ Create Internal Shipment with lead time::
>>> shipment.outgoing_moves[0].state
'done'
>>> assertEqual(shipment.outgoing_moves[0].effective_date, yesterday)
>>> shipment.click('done')
>>> shipment.click('do')
>>> shipment.incoming_moves[0].state
'done'
>>> assertEqual(shipment.incoming_moves[0].effective_date, today)
@@ -190,7 +190,7 @@ Ignore non assigned moves and pack shipment::
Set the state as Done::
>>> shipment_out.click('done')
>>> shipment_out.click('do')
>>> assertEqual(shipment_out.done_by, employee)
>>> [m.state for m in shipment_out.outgoing_moves]
['done']
@@ -263,7 +263,7 @@ Finish the shipment::
Finish the shipment::
>>> shipment_out.click('done')
>>> shipment_out.click('do')
>>> shipment_out.state
'done'
>>> outgoing_move, = shipment_out.outgoing_moves
@@ -85,7 +85,7 @@ Receive shipment::
Finish the shipment::
>>> shipment.click('done')
>>> shipment.click('do')
>>> shipment.state
'done'
>>> len(shipment.incoming_moves)
+1 -1
View File
@@ -43,7 +43,7 @@ this repository contains the full copyright notices and license terms. -->
<group col="-1" colspan="2" id="buttons">
<button name="cancel" icon="tryton-cancel"/>
<button name="receive" icon="tryton-forward"/>
<button name="done" icon="tryton-ok"/>
<button name="do" icon="tryton-ok"/>
<button name="draft" icon="tryton-undo"/>
</group>
</form>
@@ -36,6 +36,6 @@ this repository contains the full copyright notices and license terms. -->
<button name="draft" icon="tryton-forward"/>
<button name="wait"/>
<button name="assign_wizard" icon="tryton-forward"/>
<button name="done" icon="tryton-ok"/>
<button name="do" icon="tryton-ok"/>
</group>
</form>
@@ -47,6 +47,6 @@ this repository contains the full copyright notices and license terms. -->
<button name="wait"/>
<button name="assign_wizard" icon="tryton-forward"/>
<button name="ship" icon="tryton-ok"/>
<button name="done" icon="tryton-ok"/>
<button name="do" icon="tryton-ok"/>
</group>
</form>
+1 -1
View File
@@ -48,6 +48,6 @@ this repository contains the full copyright notices and license terms. -->
<button name="assign_wizard" icon="tryton-forward"/>
<button name="pick"/>
<button name="pack" icon="tryton-forward"/>
<button name="done" icon="tryton-ok"/>
<button name="do" icon="tryton-ok"/>
</group>
</form>
@@ -43,6 +43,6 @@ this repository contains the full copyright notices and license terms. -->
<button name="cancel" icon="tryton-cancel"/>
<button name="draft" icon="tryton-clear"/>
<button name="receive" icon="tryton-forward"/>
<button name="done" icon="tryton-ok"/>
<button name="do" icon="tryton-ok"/>
</group>
</form>