[MERGE] forward port of branch 7.0 up to revid 9668 launchpad_translations_on_behalf_of_openerp-20131130053134-6u83vcd1133xs8yf
bzr revid: chs@openerp.com-20131130130014-hi5h5a00kjx0dbvp
This commit is contained in:
commit
0ac4a8f696
|
@ -3414,6 +3414,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
all the provided information to create the accounts, the banks, the journals, the taxes, the tax codes, the
|
||||
accounting properties... accordingly for the chosen company.
|
||||
'''
|
||||
if uid != SUPERUSER_ID and not self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager'):
|
||||
raise openerp.exceptions.AccessError(_("Only administrators can change the settings"))
|
||||
obj_data = self.pool.get('ir.model.data')
|
||||
ir_values_obj = self.pool.get('ir.values')
|
||||
obj_wizard = self.browse(cr, uid, ids[0])
|
||||
|
@ -3430,7 +3432,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
self.pool[tmp2[0]].write(cr, uid, tmp2[1], {
|
||||
'currency_id': obj_wizard.currency_id.id
|
||||
})
|
||||
except ValueError, e:
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# If the floats for sale/purchase rates have been filled, create templates from them
|
||||
|
|
|
@ -22,13 +22,12 @@
|
|||
import time
|
||||
import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from operator import itemgetter
|
||||
from os.path import join as opj
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
|
||||
from openerp.tools.translate import _
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import tools
|
||||
|
||||
class account_config_settings(osv.osv_memory):
|
||||
_name = 'account.config.settings'
|
||||
|
@ -276,11 +275,13 @@ class account_config_settings(osv.osv_memory):
|
|||
|
||||
def set_default_taxes(self, cr, uid, ids, context=None):
|
||||
""" set default sale and purchase taxes for products """
|
||||
if uid != SUPERUSER_ID and not self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager'):
|
||||
raise openerp.exceptions.AccessError(_("Only administrators can change the settings"))
|
||||
ir_values = self.pool.get('ir.values')
|
||||
config = self.browse(cr, uid, ids[0], context)
|
||||
ir_values.set_default(cr, uid, 'product.product', 'taxes_id',
|
||||
ir_values.set_default(cr, SUPERUSER_ID, 'product.product', 'taxes_id',
|
||||
config.default_sale_tax and [config.default_sale_tax.id] or False, company_id=config.company_id.id)
|
||||
ir_values.set_default(cr, uid, 'product.product', 'supplier_taxes_id',
|
||||
ir_values.set_default(cr, SUPERUSER_ID, 'product.product', 'supplier_taxes_id',
|
||||
config.default_purchase_tax and [config.default_purchase_tax.id] or False, company_id=config.company_id.id)
|
||||
|
||||
def set_chart_of_accounts(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -38,6 +38,9 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
|||
'section_id': fields.many2one('crm.case.section', 'Sales Team', select=True),
|
||||
}
|
||||
|
||||
def onchange_action(self, cr, uid, ids, action, context=None):
|
||||
return {'value': {'partner_id': False if action != 'exist' else self._find_matching_partner(cr, uid, context=context)}}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
Default get for name, opportunity_ids.
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</field>
|
||||
</group>
|
||||
<group name="action" attrs="{'invisible': [('name', '!=', 'convert')]}">
|
||||
<field name="action" class="oe_inline"/>
|
||||
<field name="action" on_change="onchange_action(action, context)" class="oe_inline"/>
|
||||
<field name="partner_id"
|
||||
attrs="{'required': [('action', '=', 'exist')], 'invisible':[('action','!=','exist')]}"
|
||||
class="oe_inline"/>
|
||||
|
|
|
@ -51,7 +51,9 @@
|
|||
<search string="Search">
|
||||
<filter string="My Sales Team(s)" icon="terp-personal+" context="{'invisible_section': False}" domain="[('section_id.user_id','=',uid)]" help="My Sales Team(s)" groups="base.group_multi_salesteams"/>
|
||||
<separator/>
|
||||
<filter string="My Company" icon="terp-go-home" context="{'invisible_section': False}" domain="[('section_id.user_id.company_id','=',uid)]" help="My company"/>
|
||||
<!-- A 'My Company' filter makes no sense regarding record rules, and is not possible to do (uid is not a company): remove me in 8.0 -->
|
||||
<filter string="My Company" icon="terp-go-home" context="{'invisible_section': False}" domain="[]" help="My company"
|
||||
invisible="1"/>
|
||||
<separator/>
|
||||
<filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
|
|
|
@ -69,7 +69,11 @@ class document_file(osv.osv):
|
|||
|
||||
def check(self, cr, uid, ids, mode, context=None, values=None):
|
||||
"""Overwrite check to verify access on directory to validate specifications of doc/access_permissions.rst"""
|
||||
if not isinstance(ids, list):
|
||||
ids = [ids]
|
||||
|
||||
super(document_file, self).check(cr, uid, ids, mode, context=context, values=values)
|
||||
|
||||
if ids:
|
||||
self.pool.get('ir.model.access').check(cr, uid, 'document.directory', mode)
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@
|
|||
margin-bottom: 4px;
|
||||
}
|
||||
.openerp .oe_followers .oe_invite{
|
||||
float: right;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.openerp .oe_followers .oe_partner {
|
||||
height: 32px;
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
font-family: arial, sans-serif;
|
||||
font-size: 15px;
|
||||
line-height: 19px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.openerp .oe_form_nomargin .etherpad_readonly{
|
||||
|
|
|
@ -860,6 +860,14 @@ class purchase_order_line(osv.osv):
|
|||
res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
|
||||
return res
|
||||
|
||||
def _get_uom_id(self, cr, uid, context=None):
|
||||
try:
|
||||
proxy = self.pool.get('ir.model.data')
|
||||
result = proxy.get_object_reference(cr, uid, 'product', 'product_uom_unit')
|
||||
return result[1]
|
||||
except Exception, ex:
|
||||
return False
|
||||
|
||||
_columns = {
|
||||
'name': fields.text('Description', required=True),
|
||||
'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
|
||||
|
@ -886,6 +894,7 @@ class purchase_order_line(osv.osv):
|
|||
|
||||
}
|
||||
_defaults = {
|
||||
'product_uom' : _get_uom_id,
|
||||
'product_qty': lambda *a: 1.0,
|
||||
'state': lambda *args: 'draft',
|
||||
'invoiced': lambda *a: 0,
|
||||
|
|
|
@ -199,7 +199,7 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="date_order"/>
|
||||
<field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
|
||||
<field name="origin" attrs="{'invisible': [('origin','=',False)]}"/>
|
||||
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
|
|
|
@ -61,7 +61,7 @@ class sale_order_line_make_invoice(osv.osv_memory):
|
|||
else:
|
||||
pay_term = False
|
||||
inv = {
|
||||
'name': order.name,
|
||||
'name': order.client_order_ref or '',
|
||||
'origin': order.name,
|
||||
'type': 'out_invoice',
|
||||
'reference': "P%dSO%d" % (order.partner_id.id, order.id),
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
@ -72,12 +74,13 @@ class sale_configuration(osv.osv_memory):
|
|||
}
|
||||
|
||||
def set_sale_defaults(self, cr, uid, ids, context=None):
|
||||
if uid != SUPERUSER_ID and not self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager'):
|
||||
raise openerp.exceptions.AccessError(_("Only administrators can change the settings"))
|
||||
ir_values = self.pool.get('ir.values')
|
||||
ir_model_data = self.pool.get('ir.model.data')
|
||||
wizard = self.browse(cr, uid, ids)[0]
|
||||
|
||||
default_picking_policy = 'one' if wizard.default_picking_policy else 'direct'
|
||||
ir_values.set_default(cr, uid, 'sale.order', 'picking_policy', default_picking_policy)
|
||||
ir_values.set_default(cr, SUPERUSER_ID, 'sale.order', 'picking_policy', default_picking_policy)
|
||||
res = super(sale_configuration, self).set_sale_defaults(cr, uid, ids, context)
|
||||
return res
|
||||
|
||||
|
|
|
@ -604,7 +604,7 @@ class sale_order_line(osv.osv):
|
|||
#check if product is available, and if not: raise an error
|
||||
uom2 = False
|
||||
if uom:
|
||||
uom2 = product_uom_obj.browse(cr, uid, uom)
|
||||
uom2 = product_uom_obj.browse(cr, uid, uom, context=context)
|
||||
if product_obj.uom_id.category_id.id != uom2.category_id.id:
|
||||
uom = False
|
||||
if not uom2:
|
||||
|
|
|
@ -1361,9 +1361,9 @@ class stock_picking(osv.osv):
|
|||
self.action_move(cr, uid, [new_picking], context=context)
|
||||
self.signal_button_done(cr, uid, [new_picking])
|
||||
workflow.trg_write(uid, 'stock.picking', pick.id, cr)
|
||||
delivered_pack_id = new_picking
|
||||
delivered_pack_id = pick.id
|
||||
back_order_name = self.browse(cr, uid, delivered_pack_id, context=context).name
|
||||
self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_order_name), context=context)
|
||||
self.message_post(cr, uid, new_picking, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_order_name), context=context)
|
||||
else:
|
||||
self.action_move(cr, uid, [pick.id], context=context)
|
||||
self.signal_button_done(cr, uid, [pick.id])
|
||||
|
|
Loading…
Reference in New Issue