Accept Merge Request #951: (feature/制造代码优化 -> develop)

Merge Request: 三次元检测z计算修改

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/951?initial=true
This commit is contained in:
马广威
2024-04-17 17:03:38 +08:00
committed by Coding
2 changed files with 22 additions and 6 deletions

View File

@@ -364,6 +364,7 @@ class ResMrpWorkOrder(models.Model):
y7 = self.Y7_axis
y8 = self.Y8_axis
z1 = self.Z9_axis
z2 = self.Z10_axis
x0 = ((x3 - x4) * (x2 * y1 - x1 * y2) - (x1 - x2) * (x4 * y3 - x3 * y4)) / (
(x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4))
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))
x = (x0 + x1) / 2
y = (y0 + y1) / 2
z = z1 / 2
z = (z1 + z2) / 2
jd = math.atan2((x5 - x6), (y5 - y6))
jdz = jd * 180 / math.pi

View File

@@ -226,6 +226,7 @@ class SfShelf(models.Model):
_order = 'create_date desc'
name = fields.Char('货架名称', required=True, size=20)
active = fields.Boolean("有效", default=True)
barcode = fields.Char('编码', copy=False, size=15, required=True)
# 货位
location_ids = fields.One2many('sf.shelf.location', 'shelf_id', string='货位')
@@ -304,6 +305,7 @@ class SfShelf(models.Model):
class ShelfLocation(models.Model):
_name = 'sf.shelf.location'
_description = '货位'
_rec_name = 'barcode'
_order = 'id asc, create_date asc'
# 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', '目标位置调拨单')
storage_time = fields.Datetime('入库时间', compute='_compute_location_status')
production_id = fields.Many2one('mrp.production', string='制造订单')
active = fields.Boolean("有效", default=True)
@api.depends('location_status')
def _compute_location_status(self):
@@ -865,15 +868,27 @@ class SfProcurementGroup(models.Model):
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):
_inherit = 'stock.picking.type'
def _default_show_operations(self):
return self.user_has_groups('stock.group_production_lot,'
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')
'stock.group_tracking_lot,'
'sf_warehouse.group_sf_stock_user,'
'sf_warehouse.group_sf_stock_manager'
)
class CustomStockMove(models.Model):