[MERGE] merged the dev2 branch

bzr revid: qdp-launchpad@tinyerp.com-20110117180333-9h6p7e1lwxk1mmz3
This commit is contained in:
qdp-launchpad@tinyerp.com 2011-01-17 19:03:33 +01:00
commit 6cd9f64973
6 changed files with 28 additions and 14 deletions

View File

@ -438,8 +438,8 @@ class mrp_production(osv.osv):
'date_planned_end': fields.function(_production_date_end, method=True, type='date', string='Scheduled End Date'),
'date_planned_date': fields.function(_production_date, method=True, type='date', string='Scheduled Date'),
'date_planned': fields.datetime('Scheduled date', required=True, select=1),
'date_start': fields.datetime('Start Date'),
'date_finished': fields.datetime('End Date'),
'date_start': fields.datetime('Start Date', select=True),
'date_finished': fields.datetime('End Date', select=True),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)]),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),

View File

@ -92,3 +92,4 @@
"access_account_account_mrp_manager","account.account mrp manager","account.model_account_account","mrp.group_mrp_manager",1,0,0,0
"access_account_journal_mrp_manager","account.journal mrp manager","account.model_account_journal","mrp.group_mrp_manager",1,0,0,0
"access_stock_location_mrp_manager","stock.location product mrp manager","stock.model_stock_location","mrp.group_mrp_manager",1,0,0,0
"access_purchase_order_stock_user","purchase.order stock user","purchase.model_purchase_order","stock.group_stock_user",1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
92 access_account_account_mrp_manager account.account mrp manager account.model_account_account mrp.group_mrp_manager 1 0 0 0
93 access_account_journal_mrp_manager account.journal mrp manager account.model_account_journal mrp.group_mrp_manager 1 0 0 0
94 access_stock_location_mrp_manager stock.location product mrp manager stock.model_stock_location mrp.group_mrp_manager 1 0 0 0
95 access_purchase_order_stock_user purchase.order stock user purchase.model_purchase_order stock.group_stock_user 1 1 1 0

View File

@ -254,6 +254,7 @@
<!-- add product_uom to context to be the default value when adding new orderpoints -->
<act_window
context="{'product_uom': locals().has_key('uom_id') and uom_id,'search_default_product_id': [active_id]}"
domain="[('product_id', '=', active_id)]"
id="act_product_product_2_stock_warehouse_orderpoint"
name="Minimum Stock Rules"
res_model="stock.warehouse.orderpoint"

View File

@ -162,8 +162,8 @@ class purchase_order(osv.osv):
help="Reference of the document that generated this purchase order request."
),
'partner_ref': fields.char('Supplier Reference', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, size=64),
'date_order':fields.date('Date Ordered', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, help="Date on which this document has been created."),
'date_approve':fields.date('Date Approved', readonly=1, help="Date on which purchase order has been approved"),
'date_order':fields.date('Date Ordered', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, select=True, help="Date on which this document has been created."),
'date_approve':fields.date('Date Approved', readonly=1, select=True, help="Date on which purchase order has been approved"),
'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, change_default=True),
'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True,
states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},domain="[('partner_id', '=', partner_id)]"),
@ -191,7 +191,7 @@ class purchase_order(osv.osv):
"From Picking: a draft invoice will be pre-generated based on validated receptions.\n" \
"Manual: allows you to generate suppliers invoices by chosing in the uninvoiced lines of all manual purchase orders."
),
'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True,store=True, string='Expected Date', type='date', help="This is computed as the minimum scheduled date of all purchase order lines' products."),
'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True,store=True, string='Expected Date', type='date', select=True, help="This is computed as the minimum scheduled date of all purchase order lines' products."),
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount',
store={
'purchase.order.line': (_get_order, None, 10),
@ -605,7 +605,7 @@ class purchase_order_line(osv.osv):
_columns = {
'name': fields.char('Description', size=256, required=True),
'product_qty': fields.float('Quantity', required=True, digits=(16,2)),
'date_planned': fields.date('Scheduled Date', required=True),
'date_planned': fields.date('Scheduled Date', required=True, select=True),
'taxes_id': fields.many2many('account.tax', 'purchase_order_taxe', 'ord_id', 'tax_id', 'Taxes'),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'product_id': fields.many2one('product.product', 'Product', domain=[('purchase_ok','=',True)], change_default=True),

View File

@ -208,6 +208,8 @@ class stock_location(osv.osv):
'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock", digits_compute=dp.get_precision('Account')),
'company_id': fields.many2one('res.company', 'Company', select=1, help='Let this field empty if this location is shared between all companies'),
'scrap_location': fields.boolean('Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'),
'valuation_in_account_id': fields.many2one('account.account', 'Stock Input Account',domain = [('type','=','other')], help='This account will be used to value stock moves that have this location as destination, instead of the stock output account from the product.'),
'valuation_out_account_id': fields.many2one('account.account', 'Stock Output Account',domain = [('type','=','other')], help='This account will be used ta value stock moves that have this location as source, instead of the stock input account from the product.'),
}
_defaults = {
'active': True,
@ -1515,9 +1517,9 @@ class stock_move(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True, select=True),
'priority': fields.selection([('0', 'Not urgent'), ('1', 'Urgent')], 'Priority'),
'create_date': fields.datetime('Creation Date', readonly=True),
'date': fields.datetime('Date', required=True, help="Move date: scheduled date until move is done, then date of actual move processing", readonly=True),
'date_expected': fields.datetime('Scheduled Date', states={'done': [('readonly', True)]},required=True, help="Scheduled date for the processing of this move"),
'create_date': fields.datetime('Creation Date', readonly=True, select=True),
'date': fields.datetime('Date', required=True, select=True, help="Move date: scheduled date until move is done, then date of actual move processing", readonly=True),
'date_expected': fields.datetime('Scheduled Date', states={'done': [('readonly', True)]},required=True, select=True, help="Scheduled date for the processing of this move"),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')],states={'done': [('readonly', True)]}),
'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), required=True,states={'done': [('readonly', True)]}),
@ -1985,8 +1987,16 @@ class stock_move(osv.osv):
"""
product_obj=self.pool.get('product.product')
accounts = product_obj.get_product_accounts(cr, uid, move.product_id.id, context)
acc_src = accounts['stock_account_input']
acc_dest = accounts['stock_account_output']
if move.location_id.valuation_out_account_id:
acc_src = move.location_id.valuation_out_account_id.id
else:
acc_src = accounts['stock_account_input']
if move.location_dest_id.valuation_in_account_id:
acc_dest = move.location_dest_id.valuation_in_account_id.id
else:
acc_dest = accounts['stock_account_output']
acc_variation = accounts.get('property_stock_variation', False)
journal_id = accounts['stock_journal']
@ -2008,7 +2018,6 @@ class stock_move(osv.osv):
if not acc_variation:
raise osv.except_osv(_('Error!'), _('There is no inventory variation account defined on the product category: "%s" (id: %d)') % \
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
return journal_id, acc_src, acc_dest, acc_variation
def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
@ -2605,7 +2614,7 @@ class stock_inventory(osv.osv):
account_move_data_l = account_move_obj.read(cr, uid, account_move_ids, ['state'], context=context)
for account_move in account_move_data_l:
if account_move['state'] == 'posted':
raise osv.except_osv(_('UserError'),
raise osv.except_osv(_('UserError'),
_('You can not cancel inventory which has any account move with posted state.'))
account_move_obj.unlink(cr, uid, [account_move['id']], context=context)
self.write(cr, uid, [inv.id], {'state': 'cancel'}, context=context)

View File

@ -410,7 +410,7 @@
<field name="context">{'full':'1',"search_default_available":1}</field>
<field name="help">This is the list of all the production lots (serial numbers) you recorded. When you select a lot, you can get the upstream or downstream traceability of the products contained in lot. By default, the list is filtred on the serial numbers that are available in your warehouse but you can uncheck the 'Available' button to get all the lots you produced, received or delivered to customers.</field>
</record>
<menuitem action="action_production_lot_form" id="menu_action_production_lot_form"
<menuitem action="action_production_lot_form" id="menu_action_production_lot_form"
parent="menu_traceability" groups="base.group_extended"
sequence="1"/>
@ -501,6 +501,9 @@
<field name="posx"/>
<field name="posy"/>
<field name="posz"/>
<separator string="Accounting Information" colspan="2" groups="base.group_extended"/>
<field name="valuation_in_account_id" attrs="{'readonly':[('usage','not in',('inventory','production'))]}" groups="base.group_extended"/>
<field name="valuation_out_account_id" attrs="{'readonly':[('usage','not in',('inventory','production'))]}" groups="base.group_extended"/>
</group>
<separator string="Additional Information" colspan="4"/>
<field colspan="4" name="comment" nolabel="1"/>