三次元检测z计算修改
This commit is contained in:
@@ -364,6 +364,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
y7 = self.Y7_axis
|
y7 = self.Y7_axis
|
||||||
y8 = self.Y8_axis
|
y8 = self.Y8_axis
|
||||||
z1 = self.Z9_axis
|
z1 = self.Z9_axis
|
||||||
|
z2 = self.Z10_axis
|
||||||
x0 = ((x3 - x4) * (x2 * y1 - x1 * y2) - (x1 - x2) * (x4 * y3 - x3 * y4)) / (
|
x0 = ((x3 - x4) * (x2 * y1 - x1 * y2) - (x1 - x2) * (x4 * y3 - x3 * y4)) / (
|
||||||
(x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4))
|
(x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4))
|
||||||
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
|
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
|
||||||
@@ -374,7 +375,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
|
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
|
||||||
x = (x0 + x1) / 2
|
x = (x0 + x1) / 2
|
||||||
y = (y0 + y1) / 2
|
y = (y0 + y1) / 2
|
||||||
z = z1 / 2
|
z = (z1 + z2) / 2
|
||||||
|
|
||||||
jd = math.atan2((x5 - x6), (y5 - y6))
|
jd = math.atan2((x5 - x6), (y5 - y6))
|
||||||
jdz = jd * 180 / math.pi
|
jdz = jd * 180 / math.pi
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ class SfShelf(models.Model):
|
|||||||
_order = 'create_date desc'
|
_order = 'create_date desc'
|
||||||
|
|
||||||
name = fields.Char('货架名称', required=True, size=20)
|
name = fields.Char('货架名称', required=True, size=20)
|
||||||
|
active = fields.Boolean("有效", default=True)
|
||||||
barcode = fields.Char('编码', copy=False, size=15, required=True)
|
barcode = fields.Char('编码', copy=False, size=15, required=True)
|
||||||
# 货位
|
# 货位
|
||||||
location_ids = fields.One2many('sf.shelf.location', 'shelf_id', string='货位')
|
location_ids = fields.One2many('sf.shelf.location', 'shelf_id', string='货位')
|
||||||
@@ -304,6 +305,7 @@ class SfShelf(models.Model):
|
|||||||
class ShelfLocation(models.Model):
|
class ShelfLocation(models.Model):
|
||||||
_name = 'sf.shelf.location'
|
_name = 'sf.shelf.location'
|
||||||
_description = '货位'
|
_description = '货位'
|
||||||
|
_rec_name = 'barcode'
|
||||||
_order = 'id asc, create_date asc'
|
_order = 'id asc, create_date asc'
|
||||||
|
|
||||||
# current_location_id = fields.Many2one('sf.shelf.location', string='当前位置')
|
# current_location_id = fields.Many2one('sf.shelf.location', string='当前位置')
|
||||||
@@ -313,6 +315,7 @@ class ShelfLocation(models.Model):
|
|||||||
destination_move_ids = fields.One2many('stock.move.line', 'destination_location_id', '目标位置调拨单')
|
destination_move_ids = fields.One2many('stock.move.line', 'destination_location_id', '目标位置调拨单')
|
||||||
storage_time = fields.Datetime('入库时间', compute='_compute_location_status')
|
storage_time = fields.Datetime('入库时间', compute='_compute_location_status')
|
||||||
production_id = fields.Many2one('mrp.production', string='制造订单')
|
production_id = fields.Many2one('mrp.production', string='制造订单')
|
||||||
|
active = fields.Boolean("有效", default=True)
|
||||||
|
|
||||||
@api.depends('location_status')
|
@api.depends('location_status')
|
||||||
def _compute_location_status(self):
|
def _compute_location_status(self):
|
||||||
@@ -859,15 +862,27 @@ class SfProcurementGroup(models.Model):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
# class SfPickingType(models.Model):
|
||||||
|
# _inherit = 'stock.picking.type'
|
||||||
|
#
|
||||||
|
# def _default_show_operations(self):
|
||||||
|
# return self.user_has_groups('stock.group_production_lot,'
|
||||||
|
# 'stock.group_stock_multi_locations,'
|
||||||
|
# 'stock.group_tracking_lot',
|
||||||
|
# 'sf_warehouse.group_sf_stock_user',
|
||||||
|
# 'sf_warehouse.group_sf_stock_manager')
|
||||||
|
|
||||||
class SfPickingType(models.Model):
|
class SfPickingType(models.Model):
|
||||||
_inherit = 'stock.picking.type'
|
_inherit = 'stock.picking.type'
|
||||||
|
|
||||||
def _default_show_operations(self):
|
def _default_show_operations(self):
|
||||||
return self.user_has_groups('stock.group_production_lot,'
|
return self.user_has_groups(
|
||||||
'stock.group_stock_multi_locations,'
|
'stock.group_production_lot,'
|
||||||
'stock.group_tracking_lot',
|
'stock.group_stock_multi_locations,'
|
||||||
'sf_warehouse.group_sf_stock_user',
|
'stock.group_tracking_lot,'
|
||||||
'sf_warehouse.group_sf_stock_manager')
|
'sf_warehouse.group_sf_stock_user,'
|
||||||
|
'sf_warehouse.group_sf_stock_manager'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CustomStockMove(models.Model):
|
class CustomStockMove(models.Model):
|
||||||
|
|||||||
Reference in New Issue
Block a user