[IMP] stock: rename and add button for inventory adj print

Rename "Inventory" to "Count Sheet" under print dropdown and add in a
"Print Count Sheet" button to inventory adjustment.

This covers specification 2 of inventory usability update.

Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
This commit is contained in:
Tiffany Chang (tic)
2020-06-22 11:55:18 +00:00
parent 7f21258d39
commit 3b3ec888c8
3 changed files with 5 additions and 1 deletions
+3
View File
@@ -214,6 +214,9 @@ class Inventory(models.Model):
}
return action
def action_print(self):
return self.env.ref('stock.action_report_inventory').report_action(self)
def _get_quantities(self):
"""Return quantities group by product_id, location_id, lot_id, package_id and owner_id
+1 -1
View File
@@ -20,7 +20,7 @@
print_report_name="'Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)"
/>
<report
string="Inventory"
string="Count Sheet"
id="action_report_inventory"
model="stock.inventory"
report_type="qweb-pdf"
@@ -168,6 +168,7 @@
<button name="action_open_inventory_lines" states="confirm" string="Continue Inventory" type="object" class="oe_highlight" groups="stock.group_stock_user"/>
<button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '!=', [])]}" groups="stock.group_stock_manager"/>
<button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '=', [])]}" class="oe_highlight" groups="stock.group_stock_manager"/>
<button name="action_print" string="Print Count Sheet" type="object" attrs="{'invisible': [('state', '=', 'draft')]}" groups="stock.group_stock_user"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name="action_cancel_draft" states="confirm" string="Cancel Inventory" type="object"
confirm="If you cancel this inventory adjustment, all its inventory adjustment lines will be lost. Are you sure you want to discard it ?"/>