[IMP] multi-company fields
bzr revid: fp@tinyerp.com-20091222190737-gyye9ubuk5vrq8dj
This commit is contained in:
parent
eb665f6e1d
commit
3cc2c44407
|
@ -276,7 +276,7 @@ class product_template(osv.osv):
|
|||
'loc_rack': fields.char('Rack', size=16),
|
||||
'loc_row': fields.char('Row', size=16),
|
||||
'loc_case': fields.char('Case', size=16),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'company_id': fields.many2one('res.company', 'Company',select=1),
|
||||
}
|
||||
|
||||
def _get_uom_id(self, cr, uid, *args):
|
||||
|
@ -633,7 +633,7 @@ class product_supplierinfo(osv.osv):
|
|||
'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True),
|
||||
'delay' : fields.integer('Delivery Delay', required=True, help="Delay in days between the confirmation of the purchase order and the reception of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."),
|
||||
'pricelist_ids': fields.one2many('pricelist.partnerinfo', 'suppinfo_id', 'Supplier Pricelist'),
|
||||
'company_id':fields.many2one('res.company','Company'),
|
||||
'company_id':fields.many2one('res.company','Company',select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'qty': lambda *a: 0.0,
|
||||
|
|
|
@ -195,7 +195,7 @@ class purchase_order(osv.osv):
|
|||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
|
||||
'product_id': fields.related('order_line','product_id', type='many2one', relation='product.product', string='Product'),
|
||||
'create_uid': fields.many2one('res.users', 'Responsible'),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
'company_id': fields.many2one('res.company','Company',required=True,select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'date_order': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
|
@ -456,7 +456,7 @@ class purchase_order_line(osv.osv):
|
|||
'notes': fields.text('Notes'),
|
||||
'order_id': fields.many2one('purchase.order', 'Order Ref', select=True, required=True, ondelete='cascade'),
|
||||
'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',),
|
||||
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
|
||||
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company')
|
||||
}
|
||||
_defaults = {
|
||||
'product_qty': lambda *a: 1.0
|
||||
|
|
|
@ -254,7 +254,7 @@ class sale_order(osv.osv):
|
|||
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True),
|
||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
|
||||
'company_id': fields.many2one('res.company','Company'),
|
||||
'company_id': fields.many2one('res.company','Company',select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', c),
|
||||
|
@ -778,7 +778,7 @@ class sale_order_line(osv.osv):
|
|||
'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled'), ('exception', 'Exception')], 'State', required=True, readonly=True),
|
||||
'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', string='Customer'),
|
||||
'salesman_id':fields.related('order_id','user_id',type='many2one',relation='res.users',string='Salesman'),
|
||||
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
|
||||
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company'),
|
||||
}
|
||||
_order = 'sequence, id'
|
||||
_defaults = {
|
||||
|
|
|
@ -167,7 +167,7 @@ class stock_location(osv.osv):
|
|||
'parent_right': fields.integer('Right Parent', select=1),
|
||||
'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock"),
|
||||
'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
|
@ -474,7 +474,7 @@ class stock_picking(osv.osv):
|
|||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not from Picking")], "Invoice Status",
|
||||
select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda self, cr, uid, context: '/',
|
||||
|
@ -888,7 +888,7 @@ class stock_production_lot(osv.osv):
|
|||
'date': fields.datetime('Created Date', required=True),
|
||||
'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select="2"),
|
||||
'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'),
|
||||
'company_id': fields.many2one('res.company','Company'),
|
||||
'company_id': fields.many2one('res.company','Company',select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
|
@ -912,7 +912,7 @@ class stock_production_lot_revision(osv.osv):
|
|||
'indice': fields.char('Revision', size=16),
|
||||
'author_id': fields.many2one('res.users', 'Author'),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Production lot', select=True, ondelete='cascade'),
|
||||
'company_id': fields.related('lot_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
|
||||
'company_id': fields.related('lot_id','company_id',type='many2one',relation='res.company',string='Company'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -1000,7 +1000,7 @@ class stock_move(osv.osv):
|
|||
\nThe state is \'Waiting\' if the move is waiting for another one.'),
|
||||
'price_unit': fields.float('Unit Price',
|
||||
digits=(16, int(config['price_accuracy']))),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
|
||||
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
|
||||
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Orders"),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
|
||||
|
@ -1387,7 +1387,7 @@ class stock_inventory(osv.osv):
|
|||
'inventory_line_id': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'move_ids': fields.many2many('stock.move', 'stock_inventory_move_rel', 'inventory_id', 'move_id', 'Created Moves'),
|
||||
'state': fields.selection( (('draft', 'Draft'), ('done', 'Done'), ('cancel','Cancelled')), 'State', readonly=True),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
'company_id': fields.many2one('res.company','Company',required=True,select=1),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
|
@ -1460,7 +1460,7 @@ class stock_inventory_line(osv.osv):
|
|||
'product_id': fields.many2one('product.product', 'Product', required=True),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
|
||||
'product_qty': fields.float('Quantity'),
|
||||
'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
|
||||
'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company')
|
||||
}
|
||||
|
||||
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False):
|
||||
|
@ -1485,7 +1485,7 @@ class stock_warehouse(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Name', size=60, required=True),
|
||||
# 'partner_id': fields.many2one('res.partner', 'Owner'),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
'company_id': fields.many2one('res.company','Company',required=True,select=1),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Owner Address'),
|
||||
'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True),
|
||||
'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True),
|
||||
|
|
Loading…
Reference in New Issue