1878
def _get_bm_perishable(self, cr, uid, ids, field_name, args, context=None):
1881
for line in self.browse(cr, uid, ids, context=context):
1883
'hidden_batch_management_mandatory': line.product_id.batch_management,
1884
'hidden_perishable_mandatory': line.product_id.perishable,
1889
def _get_products(self, cr, uid, ids, context=None):
1890
inv_ids = self.pool.get('stock.inventory').search(cr, uid, [
1891
('state', 'not in', ['done', 'cancel']),
1893
return self.pool.get('stock.inventory.line').search(cr, uid, [
1894
('inventory_id', 'in', inv_ids),
1895
('product_id', 'in', ids),
1879
'hidden_perishable_mandatory': fields.boolean(string='Hidden Flag for Perishable product',),
1880
'hidden_batch_management_mandatory': fields.boolean(string='Hidden Flag for Batch Management product',),
1899
'hidden_perishable_mandatory': fields.function(
1903
string='Hidden Flag for Perishable product',
1904
multi='bm_perishable',
1906
'stock.inventory.line': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 10),
1907
'product.product': (_get_products, ['perishable'], 20),
1910
'hidden_batch_management_mandatory': fields.function(
1914
string='Hidden Flag for Perishable product',
1915
multi='bm_perishable',
1917
'stock.inventory.line': (lambda self, cr, uid, ids, c=None: ids, ['product_id'], 10),
1918
'product.product': (_get_products, ['batch_management'], 20),
1881
1921
# Remove the 'required' attribute on location_id to allow the possiblity to fill lines with list or nomenclature
1882
1922
# The required attribute is True on the XML view
1883
1923
'location_id': fields.many2one('stock.location', 'Location'),