采购入库时,新增打印序列号方法
This commit is contained in:
@@ -359,7 +359,6 @@ class ReStockMove(models.Model):
|
||||
materiel_height = fields.Float(string='物料高度', digits=(16, 4))
|
||||
|
||||
def _get_new_picking_values_Res(self, item, sorted_workorders, rescode):
|
||||
logging.info('new_picking-rescode: %s' % rescode)
|
||||
return {
|
||||
'name': self.env['stock.picking']._get_name_Res(rescode),
|
||||
'origin': item.name,
|
||||
@@ -373,165 +372,11 @@ class ReStockMove(models.Model):
|
||||
'state': 'confirmed',
|
||||
}
|
||||
|
||||
# 将采购到的夹具注册到Cloud
|
||||
def _register_fixture(self):
|
||||
create_url = '/api/factory_fixture_material/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
strurl = config['sf_url'] + create_url
|
||||
for item in self:
|
||||
val = {
|
||||
'token': config['token'],
|
||||
'name': item.product_id.name,
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'fixture_material_code': self.env['sf.fixture.material'].search(
|
||||
[('id', '=', item.product_id.fixture_material_id.id)]).code,
|
||||
'fixture_materials_type_code': self.env['sf.materials.model'].search(
|
||||
[('id', '=', item.product_id.materials_type_id.id)]).materials_no,
|
||||
'fixture_clamping_way': item.product_id.fixture_clamping_way,
|
||||
'fixture_port_type': item.product_id.fixture_port_type,
|
||||
'fixture_length': item.product_id.tool_length,
|
||||
'fixture_width': item.product_id.tool_width,
|
||||
'fixture_height': item.product_id.tool_height,
|
||||
'fixture_weight': item.product_id.tool_weight,
|
||||
'fixture_amount': int(item.quantity_done),
|
||||
'fixture_model_file': '' if not item.product_id.fixture_model_file else base64.b64encode(
|
||||
item.product_id.fixture_model_file).decode(
|
||||
'utf-8'),
|
||||
'fixture_clamp_workpiece_length_max': item.product_id.fixture_clamp_workpiece_length_max,
|
||||
'fixture_clamp_workpiece_width_max': item.product_id.fixture_clamp_workpiece_width_max,
|
||||
'fixture_clamp_workpiece_height_max': item.product_id.fixture_clamp_workpiece_height_max,
|
||||
'fixture_clamp_workpiece_diameter_max': item.product_id.fixture_clamp_workpiece_diameter_max,
|
||||
'fixture_maximum_carrying_weight': item.product_id.fixture_maximum_carrying_weight,
|
||||
'fixture_maximum_clamping_force': item.product_id.fixture_maximum_clamping_force,
|
||||
'fixture_driving_way': '' if not item.product_id.fixture_driving_way
|
||||
else item.product_id.fixture_driving_way,
|
||||
'fixture_apply_machine_tool_type_codes': self.env[
|
||||
'product.template']._json_apply_machine_tool_type_item_code(item),
|
||||
'fixture_through_hole_size': item.product_id.fixture_through_hole_size,
|
||||
'fixture_screw_size': item.product_id.fixture_screw_size,
|
||||
}
|
||||
try:
|
||||
if item.product_id.industry_code:
|
||||
val['industry_code'] = item.product_id.industry_code
|
||||
ret = requests.post(strurl, json={}, data=val, headers=headers)
|
||||
ret = ret.json()
|
||||
if ret['status'] == 200:
|
||||
if not item.product_id.industry_code:
|
||||
item.product_id.write({'register_state': '已注册', 'industry_code': ret['industry_code']})
|
||||
else:
|
||||
item.product_id.write({'register_state': '已注册'})
|
||||
else:
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册夹具到云端失败,请联系管理员!")
|
||||
|
||||
# 将采购到的刀具注册到Cloud
|
||||
def _register_cutting_tool(self):
|
||||
create_url = '/api/factory_cutting_tool_material/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
strurl = config['sf_url'] + create_url
|
||||
for item in self:
|
||||
val = {
|
||||
'token': config['token'],
|
||||
'name': item.product_id.name,
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'cutting_tool_material_code': self.env['sf.cutting.tool.material'].search(
|
||||
[('id', '=', item.product_id.cutting_tool_material_id.id)]).code,
|
||||
'cutting_tool_type_code': self.env['sf.cutting.tool.type'].search(
|
||||
[('id', '=', item.product_id.cutting_tool_type_id.id)]).code,
|
||||
'material_model_code': self.env['sf.materials.model'].search(
|
||||
[('id', '=', item.product_id.materials_type_id.id)]).materials_no,
|
||||
'tool_length': item.product_id.tool_length,
|
||||
'tool_width': item.product_id.tool_width,
|
||||
'tool_height': item.product_id.tool_height,
|
||||
'tool_thickness': item.product_id.tool_thickness,
|
||||
'tool_weight': item.product_id.tool_weight,
|
||||
'tool_hardness': item.product_id.tool_hardness,
|
||||
'coating_material': item.product_id.coating_material,
|
||||
'amount': int(item.quantity_done),
|
||||
# 'model_file': '' if not item.product_id.fixture_model_file else base64.b64encode(
|
||||
# item.product_id.fixture_model_file).decode(
|
||||
# 'utf-8'),
|
||||
'total_length': item.product_id.cutting_tool_total_length,
|
||||
'shank_length': item.product_id.cutting_tool_shank_length,
|
||||
'blade_length': item.product_id.cutting_tool_blade_length,
|
||||
'neck_length': item.product_id.cutting_tool_neck_length,
|
||||
'neck_diameter': item.product_id.cutting_tool_neck_diameter,
|
||||
'shank_diameter': item.product_id.cutting_tool_shank_diameter,
|
||||
'blade_tip_diameter': item.product_id.cutting_tool_blade_tip_diameter,
|
||||
'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper,
|
||||
'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle,
|
||||
'blade_type': item.product_id.cutting_tool_blade_type,
|
||||
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False
|
||||
else item.product_id.cutting_tool_coarse_medium_fine,
|
||||
'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max,
|
||||
'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min,
|
||||
'head_diameter': item.product_id.cutting_tool_head_diameter,
|
||||
'diameter': item.product_id.cutting_tool_diameter,
|
||||
'blade_number': '' if item.product_id.cutting_tool_blade_number is False
|
||||
else item.product_id.cutting_tool_blade_number,
|
||||
'front_angle': item.product_id.cutting_tool_front_angle,
|
||||
'rear_angle': item.product_id.cutting_tool_rear_angle,
|
||||
'main_included_angle': item.product_id.cutting_tool_main_included_angle,
|
||||
'chuck_codes': self.env['product.template']._json_chuck_item_code(item),
|
||||
'cutter_bar_codes': self.env['product.template']._json_cutter_bar_item_code(item),
|
||||
'cutter_pad_codes': self.env['product.template']._json_cutter_pad_item_code(item),
|
||||
'blade_codes': self.env['product.template']._json_blade_item_code(item),
|
||||
'handle_codes': self.env['product.template']._json_handle_item_code(item),
|
||||
'nut': item.product_id.cutting_tool_nut,
|
||||
'top_angle': item.product_id.cutting_tool_top_angle,
|
||||
'jump_accuracy': item.product_id.cutting_tool_jump_accuracy,
|
||||
'working_hardness': item.product_id.cutting_tool_working_hardness,
|
||||
'blade_diameter': item.product_id.cutting_tool_blade_diameter,
|
||||
'wrench': item.product_id.cutting_tool_wrench,
|
||||
'accuracy_level': item.product_id.cutting_tool_accuracy_level,
|
||||
'clamping_way': item.product_id.cutting_tool_clamping_way,
|
||||
'clamping_length': item.product_id.cutting_tool_clamping_length,
|
||||
'clamping_tolerance': item.product_id.cutting_tool_clamping_tolerance,
|
||||
'diameter_max': item.product_id.cutting_tool_diameter_max,
|
||||
'clamping_diameter_min': item.product_id.cutting_tool_clamping_diameter_min,
|
||||
'clamping_diameter_max': item.product_id.cutting_tool_clamping_diameter_max,
|
||||
'detection_accuracy_max': item.product_id.cutting_tool_detection_accuracy_max,
|
||||
'detection_accuracy_min': item.product_id.cutting_tool_detection_accuracy_min,
|
||||
'is_rough_finish': item.product_id.cutting_tool_is_rough_finish,
|
||||
'is_finish': item.product_id.cutting_tool_is_finish,
|
||||
'is_drill_hole': item.product_id.cutting_tool_is_drill_hole,
|
||||
'is_safety_lock': item.product_id.cutting_tool_is_safety_lock,
|
||||
'is_high_speed_cutting': item.product_id.cutting_tool_is_high_speed_cutting,
|
||||
'dynamic_balance_class': item.product_id.cutting_tool_dynamic_balance_class,
|
||||
'change_time': item.product_id.cutting_tool_change_time,
|
||||
'standard_speed': item.product_id.cutting_tool_standard_speed,
|
||||
'speed_max': item.product_id.cutting_tool_speed_max,
|
||||
'cooling_type': item.product_id.cutting_tool_cooling_type,
|
||||
'body_accuracy': item.product_id.cutting_tool_body_accuracy,
|
||||
'apply_lock_nut_model': item.product_id.apply_lock_nut_model,
|
||||
'apply_lock_wrench_model': item.product_id.apply_lock_wrench_model,
|
||||
'tool_taper': item.product_id.cutting_tool_taper,
|
||||
'flange_length': item.product_id.cutting_tool_flange_length,
|
||||
'flange_diameter': item.product_id.cutting_tool_flange_diameter,
|
||||
'outer_diameter': item.product_id.cutting_tool_outer_diameter,
|
||||
'inner_diameter': item.product_id.cutting_tool_inner_diameter,
|
||||
'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids,
|
||||
'er_size_model': item.product_id.cutting_tool_er_size_model,
|
||||
'image': '' if not item.product_id.image_1920 else
|
||||
base64.b64encode(item.product_id.image_1920).decode('utf-8'),
|
||||
}
|
||||
try:
|
||||
if item.product_id.industry_code:
|
||||
val['industry_code'] = item.product_id.industry_code
|
||||
ret = requests.post(strurl, json={}, data=val, headers=headers)
|
||||
ret = ret.json()
|
||||
if ret['status'] == 200:
|
||||
if not item.product_id.industry_code:
|
||||
item.product_id.write({'register_state': '已注册', 'industry_code': ret['industry_code']})
|
||||
else:
|
||||
item.product_id.write({'register_state': '已注册'})
|
||||
else:
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册刀具到云端失败,请联系管理员!")
|
||||
def print_serial_numbers(self):
|
||||
if not self.next_serial:
|
||||
raise UserError(_("请先分配序列号再进行打印"))
|
||||
for item in self.move_line_ids:
|
||||
print(item.lot_name)
|
||||
|
||||
|
||||
class ReStockQuant(models.Model):
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_stock_move_operations_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">stock.move.operations.form.inherit.sf</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_operations"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_assign_serial_show_details']" position="after">
|
||||
<button name="print_serial_numbers" string="序列号打印" type="object"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_picking_form_inherit_sf">
|
||||
<field name="name">stock.picking.form.inherit.sf</field>
|
||||
<field name="model">stock.picking</field>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import api, fields, models
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.osv import expression
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SfLocation(models.Model):
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
('location_id', '=', location_dest_id_value),
|
||||
('location_status', '=', '空闲')
|
||||
]"/>
|
||||
<!-- <field name="location_dest_id_product_type"/> -->
|
||||
<!-- <field name="location_dest_id"/> -->
|
||||
<!-- <field name="location_dest_id_product_type"/> -->
|
||||
<!-- <field name="location_dest_id"/> -->
|
||||
<field name="location_dest_id_value" invisible="1"/>
|
||||
<!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> -->
|
||||
<!-- <button name="button_test" string="测试" type="object" class="oe_highlight"/> -->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -37,26 +37,37 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 原生的按钮对base.user可见,这里修改为对库存用户可见 -->
|
||||
<!-- 原生的按钮对base.user可见,这里修改为对库存用户可见 -->
|
||||
<record id="sf_view_picking_form" model="ir.ui.view">
|
||||
<field name="name">sf.view.picking.form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//header//button[@name='action_cancel']" position="replace">
|
||||
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}" string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
|
||||
<button name="action_cancel"
|
||||
attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}"
|
||||
string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user" type="object" attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}" data-hotkey="w"/>
|
||||
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}"
|
||||
data-hotkey="w"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='button_scrap']" position="replace">
|
||||
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废" attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}" data-hotkey="y"/>
|
||||
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废"
|
||||
attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}"
|
||||
data-hotkey="y"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}" string="检查可用量" type="object" class="oe_highlight" groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
|
||||
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}"
|
||||
string="检查可用量" type="object" class="oe_highlight"
|
||||
groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
|
||||
</xpath>
|
||||
<xpath expr="//form//header//button[@name='%(stock.act_stock_return_picking)d']" position="replace">
|
||||
<button name="%(stock.act_stock_return_picking)d" string="退回" attrs="{'invisible': [('state', '!=', 'done')]}" type="action" groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||
<button name="%(stock.act_stock_return_picking)d" string="退回"
|
||||
attrs="{'invisible': [('state', '!=', 'done')]}" type="action"
|
||||
groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
@@ -68,7 +79,9 @@
|
||||
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='action_validate']" position="replace">
|
||||
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight" context="{'not_unlink_on_discard': True}" data-hotkey="v" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight"
|
||||
context="{'not_unlink_on_discard': True}" data-hotkey="v"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -79,10 +92,12 @@
|
||||
<field name="inherit_id" ref="stock.vpicktree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||
<button name="do_unreserve" type="object" string="取消保留" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="do_unreserve" type="object" string="取消保留"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//button[@name='action_assign']" position="replace">
|
||||
<button name="action_assign" type="object" string="检查可用量" groups="sf_warehouse.group_sf_stock_user"/>
|
||||
<button name="action_assign" type="object" string="检查可用量"
|
||||
groups="sf_warehouse.group_sf_stock_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -13,20 +13,23 @@ class StockMoveLine(models.Model):
|
||||
picking_location_dest_id = fields.Many2one(related='picking_id.location_dest_id')
|
||||
product_stock_quant_ids = fields.One2many('stock.quant', compute='_compute_product_stock_quant_ids')
|
||||
product_packaging_id = fields.Many2one(related='move_id.product_packaging_id')
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty', help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty',
|
||||
help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
is_completed = fields.Boolean(compute='_compute_is_completed', help="Check if the quantity done matches the demand")
|
||||
|
||||
@api.depends('product_id', 'product_id.stock_quant_ids')
|
||||
def _compute_product_stock_quant_ids(self):
|
||||
for line in self:
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(
|
||||
lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
|
||||
def _compute_dummy_id(self):
|
||||
self.dummy_id = ''
|
||||
|
||||
def _compute_product_packaging_uom_qty(self):
|
||||
for sml in self:
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(
|
||||
sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
|
||||
@api.depends('qty_done')
|
||||
def _compute_is_completed(self):
|
||||
|
||||
@@ -1,201 +1,236 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_quality" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="after">
|
||||
<field name="check_state" invisible="1"/>
|
||||
<button type="object" class="btn-info" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'in_progress')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-danger" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'fail')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-success" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'pass')]}" title="Quality Check"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1" />
|
||||
<field name="move_id" invisible="1" />
|
||||
<field name="state" invisible="1" />
|
||||
<field name="tracking" invisible="1" />
|
||||
<field name="product_uom_category_id" invisible="1" />
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed"
|
||||
attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed"
|
||||
attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed" attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed" attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done" attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline" attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number" attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number"
|
||||
attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
/>
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids" context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids"
|
||||
context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/> Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong><field name="product_id"/></strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong>
|
||||
<field name="product_id"/>
|
||||
</strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong><field name="location_id"/></strong>
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong>
|
||||
<field name="location_id"/>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}"
|
||||
groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}"
|
||||
groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/>
|
||||
<field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/>
|
||||
<field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/> <field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}" groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}" groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/><field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/><field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes" >
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes">
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,181 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo><data>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="inside">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='qty_done']" position="attributes">
|
||||
<attribute name="options">{'barcode_events': True}</attribute>
|
||||
<attribute name="widget">field_float_scannable</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1" attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1"
|
||||
attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking" name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking"
|
||||
name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title" name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span><t t-esc="record.name.value"/></span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title"
|
||||
name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span>
|
||||
<t t-esc="record.name.value"/>
|
||||
</span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation" attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation"
|
||||
attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
('code', '=', 'outgoing'),
|
||||
('restrict_scan_dest_location', '!=', 'optional'),
|
||||
]}"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data></odoo>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user