@@ -310,8 +306,8 @@ Transportista:
-
-
+
+
^XA
@@ -320,32 +316,32 @@ Transportista:
^FO20,10,0
^FO260,10
-^A0N,20,25^FD^FS
+^A0N,20,25^FD^FS
^FO20,40
^A0N,40,30
^TBN,360,40
-^FD^FS
+^FD^FS
^FO20,90
^BY3
^BCN,60,Y,N,N,A
-^FD^FS
+^FD^FS
^FX Nueva etiqueta
^LH445,0
^FO20,10,0
^FO260,10
-^A0N,20,25^FD^FS
+^A0N,20,25^FD^FS
^FO20,40
^A0N,40,30
^TBN,360,40
-^FD^FS
+^FD^FS
^FO20,90
^BY3
^BCN,60,Y,N,N,A
-^FD^FS
+^FD^FS
^XZ
diff --git a/stock_ux/security/ir.model.access.csv b/stock_ux/security/ir.model.access.csv
index e95aaa534..a2456871d 100644
--- a/stock_ux/security/ir.model.access.csv
+++ b/stock_ux/security/ir.model.access.csv
@@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_stock_operation_wizard,access_stock_operation_wizard,model_stock_operation_wizard,base.group_user,1,1,1,1
+stock_ux.access_stock_picking_zpl_lines,access_stock_picking_zpl_lines,stock_ux.model_stock_picking_zpl_lines,base.group_user,1,1,1,1
diff --git a/stock_ux/views/report_deliveryslip.xml b/stock_ux/views/report_deliveryslip.xml
index d114d4654..1c80c3cf9 100644
--- a/stock_ux/views/report_deliveryslip.xml
+++ b/stock_ux/views/report_deliveryslip.xml
@@ -41,15 +41,4 @@
-
-
diff --git a/stock_ux/views/stock_move_line_views.xml b/stock_ux/views/stock_move_line_views.xml
index b4100d920..50d4b01df 100644
--- a/stock_ux/views/stock_move_line_views.xml
+++ b/stock_ux/views/stock_move_line_views.xml
@@ -11,12 +11,19 @@
+<<<<<<< HEAD
{'default_product_id': product_id, 'active_picking_id': picking_id, 'display_complete':True}
+||||||| parent of 29a5b1f3 (temp)
+
+=======
+>>>>>>> 29a5b1f3 (temp)
@@ -105,9 +112,6 @@
{'create':True, 'create_edit':True}
{'default_product_id': product_id, 'active_picking_id': picking_id, 'default_company_id':company_id, 'display_complete':True}
-
@@ -120,9 +124,6 @@
-
{'create':True, 'create_edit':True}
@@ -136,9 +137,6 @@
stock.move.line
-
{'create':True, 'create_edit':True}
@@ -152,18 +150,6 @@
-
-
-
-
Set all undone
@@ -174,13 +160,4 @@ records.filtered(lambda x: x.state not in ['draft', 'done', 'cancel']).write({'q
-
-
-
diff --git a/stock_ux/views/stock_move_views.xml b/stock_ux/views/stock_move_views.xml
index 4f96696ba..0279bb2b0 100644
--- a/stock_ux/views/stock_move_views.xml
+++ b/stock_ux/views/stock_move_views.xml
@@ -63,13 +63,4 @@
-
-
diff --git a/stock_ux/views/stock_picking_views.xml b/stock_ux/views/stock_picking_views.xml
index 0e5cfbb9c..850495777 100644
--- a/stock_ux/views/stock_picking_views.xml
+++ b/stock_ux/views/stock_picking_views.xml
@@ -1,3 +1,4 @@
+
stock.picking.form.inherit
@@ -117,4 +118,16 @@
+
+
+ stock.picking.form
+ stock.picking
+
+
+
+
+
+
+
+
diff --git a/stock_ux/wizards/__init__.py b/stock_ux/wizards/__init__.py
index dd59ed60e..4c0eb1fbf 100644
--- a/stock_ux/wizards/__init__.py
+++ b/stock_ux/wizards/__init__.py
@@ -3,3 +3,5 @@
# directory
##############################################################################
from . import stock_operation_wizard
+from . import stock_label_type
+
diff --git a/stock_ux/wizards/stock_label_type.py b/stock_ux/wizards/stock_label_type.py
new file mode 100644
index 000000000..60b0e4365
--- /dev/null
+++ b/stock_ux/wizards/stock_label_type.py
@@ -0,0 +1,53 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import _, fields, models,api, Command
+
+
+class ProductLabelLayout(models.TransientModel):
+ _inherit = 'product.label.layout'
+ picking_id = fields.Many2one('stock.picking',string='picking')
+ line_ids = fields.One2many('stock.picking.zpl.lines','picking_zpl_id', string='Moves')
+
+ @api.model
+ def default_get(self, default_fields):
+ rec = super().default_get(default_fields)
+ active_ids = self._context.get('active_ids') or self._context.get('active_id')
+ active_model = self._context.get('active_model')
+ if active_model == 'stock.picking':
+ move_ids = self.env[active_model].browse(active_ids).mapped('move_ids').filtered(lambda x: x.quantity > 0 )
+ rec['line_ids'] = [Command.create({'move_id': x.id, 'move_quantity':x.quantity,'move_uom_id': x.product_uom}) for x in move_ids]
+ return rec
+
+ def action_print(self):
+ self.ensure_one()
+ report_id = self.env.ref("stock_ux.action_custom_barcode_transfer_template_view_zpl")
+ report_action = report_id.report_action(self.ids)
+ report_action['close_on_report_download']=True
+ return report_action
+
+ def action_print_pdf(self):
+ self.ensure_one()
+ report_id = self.env.ref("stock_ux.action_custom_label_transfer_template_view_pdf")
+ report_action = report_id.report_action(self.ids)
+ report_action['close_on_report_download']=True
+ return report_action
+
+class StockPickingZplLines(models.TransientModel):
+ _name = 'stock.picking.zpl.lines'
+ _description = "Print Stock Voucher lines"
+
+ picking_zpl_id = fields.Many2one('product.label.layout')
+
+ move_id = fields.Many2one('stock.move')
+
+ move_quantity = fields.Float()
+
+ move_uom_id = fields.Many2one('uom.uom')
+
+ name = fields.Char(related='move_id.name')
+
+ @api.constrains('move_quantity')
+ def _check_move_quantity(self):
+ for line in self:
+ if line.move_quantity > line.move_id.quantity:
+ raise exceptions.ValidationError("La cantidad a imprimir no puede ser mayor que la cantidad original.")
diff --git a/stock_ux/wizards/stock_picking_wizard.py b/stock_ux/wizards/stock_picking_wizard.py
index 27e63dba6..5e3c1fc5c 100644
--- a/stock_ux/wizards/stock_picking_wizard.py
+++ b/stock_ux/wizards/stock_picking_wizard.py
@@ -1,13 +1,13 @@
-from odoo import fields, api, models, Command
+from odoo import fields, api, models, Command, exceptions
class StockPickingZpl(models.TransientModel):
- _name = 'stock.picking.zpl'
+ _name = 'product.label.layout'
_description = "Print Stock Voucher"
picking_id = fields.Many2one('stock.picking',string='picking')
line_ids = fields.One2many('stock.picking.zpl.lines','picking_zpl_id', string='Moves')
-
+
@api.model
def default_get(self, default_fields):
rec = super().default_get(default_fields)
@@ -15,12 +15,19 @@ def default_get(self, default_fields):
active_model = self._context.get('active_model')
if active_model == 'stock.picking':
move_ids = self.env[active_model].browse(active_ids).mapped('move_ids').filtered(lambda x: x.quantity > 0 )
- rec['line_ids'] = [Command.create({'move_id': x.id, 'move_quantity':x.quantity}) for x in move_ids]
+ rec['line_ids'] = [Command.create({'move_id': x.id, 'move_quantity':x.quantity,'move_uom_id': x.product_uom}) for x in move_ids]
return rec
-
+
def action_print(self):
self.ensure_one()
- report_id = self.env.ref("stock_ux.custom_label_transfer_template_view_zpl")
+ report_id = self.env.ref("stock_ux.action_custom_barcode_transfer_template_view_zpl")
+ report_action = report_id.report_action(self.ids)
+ report_action['close_on_report_download']=True
+ return report_action
+
+ def action_print_pdf(self):
+ self.ensure_one()
+ report_id = self.env.ref("stock_ux.action_custom_label_transfer_template_view_pdf")
report_action = report_id.report_action(self.ids)
report_action['close_on_report_download']=True
return report_action
@@ -35,4 +42,14 @@ class StockPickingZplLines(models.TransientModel):
move_quantity = fields.Float()
+ move_uom_id = fields.Many2one('uom.uom')
+
name = fields.Char(related='move_id.name')
+
+ @api.constrains('move_quantity')
+ def _check_move_quantity(self):
+ for line in self:
+ if line.move_quantity > line.move_id.quantity:
+ raise exceptions.ValidationError("La cantidad a imprimir no puede ser mayor que la cantidad original.")
+
+
diff --git a/stock_ux/wizards/stock_picking_wizard_views.xml b/stock_ux/wizards/stock_picking_wizard_views.xml
index 08ffc0f74..2d679569a 100644
--- a/stock_ux/wizards/stock_picking_wizard_views.xml
+++ b/stock_ux/wizards/stock_picking_wizard_views.xml
@@ -1,34 +1,55 @@
-
- Asistente para impresion de reporte ZPL
- stock.picking.zpl
- primary
+
+ product.label.layout
+
+ stock.picking.zpl.nuevo
+<<<<<<< HEAD
-
-
+
+
+
+ -
+
+
+
-
- Asistente para impresion de reporte ZPL
- ir.actions.act_window
- stock.picking.zpl
- form
- new
+
+
+
+