1841
def _get_bm_perishable(self, cr, uid, ids, field_name, args, context=None):
1844
for line in self.browse(cr, uid, ids, context=context):
1846
'hidden_batch_management_mandatory': line.product_id.batch_management,
1847
'hidden_perishable_mandatory': line.product_id.perishable,
1852
def _get_products(self, cr, uid, ids, context=None):
1853
inv_ids = self.pool.get('stock.inventory').search(cr, uid, [
1854
('state', 'not in', ['done', 'cancel']),
1856
return self.pool.get('stock.inventory.line').search(cr, uid, [
1857
('inventory_id', 'in', inv_ids),
1858
('product_id', 'in', ids),
1842
'hidden_perishable_mandatory': fields.boolean(string='Hidden Flag for Perishable product',),
1843
'hidden_batch_management_mandatory': fields.boolean(string='Hidden Flag for Batch Management product',),
1862
'hidden_perishable_mandatory': fields.function(
1866
string='Hidden Flag for Perishable product',
1867
multi='bm_perishable',
1869
'stock.inventory.line': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 10),
1870
'product.product': (_get_products, ['perishable'], 20),
1873
'hidden_batch_management_mandatory': fields.function(
1877
string='Hidden Flag for Perishable product',
1878
multi='bm_perishable',
1880
'stock.inventory.line': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 10),
1881
'product.product': (_get_products, ['batch_management'], 20),
1844
1884
# Remove the 'required' attribute on location_id to allow the possiblity to fill lines with list or nomenclature
1845
1885
# The required attribute is True on the XML view
1846
1886
'location_id': fields.many2one('stock.location', 'Location'),