add fiel code shipment detailed report

This commit is contained in:
fabiand14 2022-08-20 09:15:41 -05:00
parent 88521b6db7
commit e5b32b94fb
2 changed files with 9 additions and 8 deletions

View File

@ -125,29 +125,29 @@ class InternalShipment(metaclass=PoolMeta):
'company': move.company.id,
'state': move.state,
}])
@fields.depends('effective_date', 'from_location', 'to_location')
def on_change_with_effective_start_date(self):
if self.effective_date:
return self.effective_date
@classmethod
def create(cls, vlist):
shipments = super().create(vlist)
cls._set_move_effective_date(shipments)
return shipments
@classmethod
def write(cls, *args):
super().write(*args)
cls._set_move_effective_date(sum(args[::2], []))
@property
def _move_effective_date(self):
'''
Return the effective date for incoming moves and inventory_moves
'''
return self.effective_start_date, self.effective_date
return self.effective_start_date, self.effective_date
@classmethod
def _set_move_effective_date(cls, shipments):
@ -178,7 +178,7 @@ class InternalShipment(metaclass=PoolMeta):
})
if to_write:
Move.write(*to_write)
def load_current_stock(self):
pool = Pool()
Internal = pool.get('stock.shipment.internal')
@ -212,7 +212,7 @@ class InternalShipment(metaclass=PoolMeta):
'moves': [('create', moves_target)],
})
return 'end'
class CreateInternalShipmentStart(ModelView):
'Create Internal Shipment Start'
@ -493,7 +493,7 @@ class ShipmentDetailedReport(Report):
)
shipments_id = [model + ',' + str(sh['id']) for sh in shipments]
fields_names = [
'product.account_category.name', 'product.name', 'product.cost_price',
'product.account_category.name', 'product.name', 'product.code', 'product.cost_price',
'quantity', 'to_location.name', 'from_location.name', 'shipment.reference',
'effective_date', 'shipment.number'
]
@ -541,6 +541,7 @@ class ShipmentDetailedReport(Report):
'party': party,
'oc': oc,
'product': product['name'],
'code': product['code'],
'cost_price': cost_price,
'category': category,
'category_ad': category_ad,

Binary file not shown.