Compare commits
14 Commits
production
...
master
Author | SHA1 | Date |
---|---|---|
Martin Trigaux | b7789771f0 | |
Harald Welte | 34f009a5ce | |
Harald Welte | efd655c0eb | |
Harald Welte | 59041f1780 | |
Stephen Medina | 36ecb63f2c | |
Harald Welte | 447d3ec46e | |
Harald Welte | 39180387a1 | |
Harald Welte | d07b59d4ba | |
Harald Welte | c077f64f57 | |
Harald Welte | bb57faa7cd | |
Harald Welte | 7c3f7945e0 | |
Harald Welte | eb0c93f6bb | |
Your Name | d32d812812 | |
EL HADJI DEM | 7b0d707417 |
|
@ -278,8 +278,10 @@ class res_partner(osv.osv):
|
||||||
|
|
||||||
# price_total is in the currency with rate = 1
|
# price_total is in the currency with rate = 1
|
||||||
# total_invoice should be displayed in the current user's currency
|
# total_invoice should be displayed in the current user's currency
|
||||||
cr.execute(query, where_clause_params + [user_currency_id])
|
# HACK: Avoid super expensive query taking 290s, see https://projects.sysmocom.de/issues/5379
|
||||||
result[partner_id] = cr.fetchone()[0]
|
#cr.execute(query, where_clause_params + [user_currency_id])
|
||||||
|
#result[partner_id] = cr.fetchone()[0]
|
||||||
|
result[partner_id] = 0
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ _ref_vat = {
|
||||||
'ro': 'RO1234567897',
|
'ro': 'RO1234567897',
|
||||||
'se': 'SE123456789701',
|
'se': 'SE123456789701',
|
||||||
'si': 'SI12345679',
|
'si': 'SI12345679',
|
||||||
'sk': 'SK0012345675',
|
'sk': 'SK1234567898',
|
||||||
'tr': 'TR1234567890 (VERGINO) veya TR12345678901 (TCKIMLIKNO)' # Levent Karakas @ Eska Yazilim A.S.
|
'tr': 'TR1234567890 (VERGINO) veya TR12345678901 (TCKIMLIKNO)' # Levent Karakas @ Eska Yazilim A.S.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<!--
|
||||||
<xpath expr="//th[@name='td_sched_date_h']" position="after">
|
<xpath expr="//th[@name='td_sched_date_h']" position="after">
|
||||||
<th t-if="o.picking_type_id.code == 'outgoing'"><strong>Carrier</strong></th>
|
<th t-if="o.picking_type_id.code == 'outgoing'"><strong>Carrier</strong></th>
|
||||||
<th><strong>Weight</strong></th>
|
<th><strong>Weight</strong></th>
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
<span t-field="o.weight"/>
|
<span t-field="o.weight"/>
|
||||||
</td>
|
</td>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
-->
|
||||||
</template>
|
</template>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<openerp>
|
<openerp>
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
|
|
||||||
|
<!--
|
||||||
<record id="analytic_journal" model="account.analytic.journal">
|
<record id="analytic_journal" model="account.analytic.journal">
|
||||||
<field name="code">TS</field>
|
<field name="code">TS</field>
|
||||||
<field name="name">Timesheet Journal</field>
|
<field name="name">Timesheet Journal</field>
|
||||||
|
@ -15,6 +16,6 @@
|
||||||
<record id="product.product_product_consultant" model="product.product">
|
<record id="product.product_product_consultant" model="product.product">
|
||||||
<field name="sale_ok">True</field>
|
<field name="sale_ok">True</field>
|
||||||
</record>
|
</record>
|
||||||
|
-->
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -126,7 +126,7 @@ class account_analytic_line(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
self._check_inv(cr, uid, ids, vals)
|
#self._check_inv(cr, uid, ids, vals)
|
||||||
return super(account_analytic_line,self).write(cr, uid, ids, vals,
|
return super(account_analytic_line,self).write(cr, uid, ids, vals,
|
||||||
context=context)
|
context=context)
|
||||||
|
|
||||||
|
@ -220,6 +220,7 @@ class account_analytic_line(osv.osv):
|
||||||
general_account = product.property_account_income or product.categ_id.property_account_income_categ
|
general_account = product.property_account_income or product.categ_id.property_account_income_categ
|
||||||
if not general_account:
|
if not general_account:
|
||||||
raise osv.except_osv(_('Error!'), _("Configuration Error!") + '\n' + _("Please define income account for product '%s'.") % product.name)
|
raise osv.except_osv(_('Error!'), _("Configuration Error!") + '\n' + _("Please define income account for product '%s'.") % product.name)
|
||||||
|
general_account = account.partner_id.property_account_position.map_account(general_account)
|
||||||
taxes = product.taxes_id or general_account.tax_ids
|
taxes = product.taxes_id or general_account.tax_ids
|
||||||
tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes, context=context)
|
tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes, context=context)
|
||||||
curr_invoice_line.update({
|
curr_invoice_line.update({
|
||||||
|
|
|
@ -162,12 +162,7 @@ class hr_timesheet_sheet(osv.osv):
|
||||||
'user_id': fields.related('employee_id', 'user_id', type="many2one", relation="res.users", store=True, string="User", required=False, readonly=True),#fields.many2one('res.users', 'User', required=True, select=1, states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
|
'user_id': fields.related('employee_id', 'user_id', type="many2one", relation="res.users", store=True, string="User", required=False, readonly=True),#fields.many2one('res.users', 'User', required=True, select=1, states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
|
||||||
'date_from': fields.date('Date from', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
|
'date_from': fields.date('Date from', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
|
||||||
'date_to': fields.date('Date to', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
|
'date_to': fields.date('Date to', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
|
||||||
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'sheet_id',
|
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'sheet_id', 'Timesheet lines'),
|
||||||
'Timesheet lines',
|
|
||||||
readonly=True, states={
|
|
||||||
'draft': [('readonly', False)],
|
|
||||||
'new': [('readonly', False)]}
|
|
||||||
),
|
|
||||||
'attendances_ids' : fields.one2many('hr.attendance', 'sheet_id', 'Attendances'),
|
'attendances_ids' : fields.one2many('hr.attendance', 'sheet_id', 'Attendances'),
|
||||||
'state' : fields.selection([
|
'state' : fields.selection([
|
||||||
('new', 'New'),
|
('new', 'New'),
|
||||||
|
@ -332,8 +327,7 @@ class hr_timesheet_line(osv.osv):
|
||||||
for ts_line in self.browse(cursor, user, ids, context=context):
|
for ts_line in self.browse(cursor, user, ids, context=context):
|
||||||
sheet_ids = sheet_obj.search(cursor, user,
|
sheet_ids = sheet_obj.search(cursor, user,
|
||||||
[('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date),
|
[('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date),
|
||||||
('employee_id.user_id', '=', ts_line.user_id.id),
|
('employee_id.user_id', '=', ts_line.user_id.id)],
|
||||||
('state', 'in', ['draft', 'new'])],
|
|
||||||
context=context)
|
context=context)
|
||||||
if sheet_ids:
|
if sheet_ids:
|
||||||
# [0] because only one sheet possible for an employee between 2 dates
|
# [0] because only one sheet possible for an employee between 2 dates
|
||||||
|
@ -386,7 +380,7 @@ class hr_timesheet_line(osv.osv):
|
||||||
|
|
||||||
def _check(self, cr, uid, ids):
|
def _check(self, cr, uid, ids):
|
||||||
for att in self.browse(cr, uid, ids):
|
for att in self.browse(cr, uid, ids):
|
||||||
if att.sheet_id and att.sheet_id.state not in ('draft', 'new'):
|
if att.sheet_id and att.sheet_id.state not in ('draft', 'new') and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_manager'):
|
||||||
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
|
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -531,7 +525,7 @@ class hr_attendance(osv.osv):
|
||||||
|
|
||||||
def _check(self, cr, uid, ids):
|
def _check(self, cr, uid, ids):
|
||||||
for att in self.browse(cr, uid, ids):
|
for att in self.browse(cr, uid, ids):
|
||||||
if att.sheet_id and att.sheet_id.state not in ('draft', 'new'):
|
if att.sheet_id and att.sheet_id.state not in ('draft', 'new') and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_manager'):
|
||||||
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet'))
|
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1130,6 +1130,8 @@ class product_product(osv.osv):
|
||||||
ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
|
ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
|
||||||
if not ids:
|
if not ids:
|
||||||
ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)
|
ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context)
|
||||||
|
if not ids:
|
||||||
|
ids = self.search(cr, user, [('x_sysmo_barcode','=',name)]+ args, limit=limit, context=context)
|
||||||
if not ids and operator not in expression.NEGATIVE_TERM_OPERATORS:
|
if not ids and operator not in expression.NEGATIVE_TERM_OPERATORS:
|
||||||
# Do not merge the 2 next lines into one single search, SQL search performance would be abysmal
|
# Do not merge the 2 next lines into one single search, SQL search performance would be abysmal
|
||||||
# on a database with thousands of matching products, due to the huge merge+unique needed for the
|
# on a database with thousands of matching products, due to the huge merge+unique needed for the
|
||||||
|
|
|
@ -89,7 +89,7 @@ class ReportController(Controller):
|
||||||
width, height, humanreadable = int(width), int(height), bool(humanreadable)
|
width, height, humanreadable = int(width), int(height), bool(humanreadable)
|
||||||
barcode = createBarcodeDrawing(
|
barcode = createBarcodeDrawing(
|
||||||
type, value=value, format='png', width=width, height=height,
|
type, value=value, format='png', width=width, height=height,
|
||||||
humanReadable = humanreadable
|
humanReadable = humanreadable, quiet=0
|
||||||
)
|
)
|
||||||
barcode = barcode.asString('png')
|
barcode = barcode.asString('png')
|
||||||
except (ValueError, AttributeError):
|
except (ValueError, AttributeError):
|
||||||
|
|
|
@ -1086,10 +1086,14 @@ class Binary(http.Controller):
|
||||||
Model = request.registry[model]
|
Model = request.registry[model]
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
cr, uid, context = request.cr, request.uid, request.context
|
||||||
fields = [field]
|
fields = [field]
|
||||||
|
content_type = 'application/octet-stream'
|
||||||
if filename_field:
|
if filename_field:
|
||||||
fields.append(filename_field)
|
fields.append(filename_field)
|
||||||
if id:
|
if id:
|
||||||
|
fields.append('file_type')
|
||||||
res = Model.read(cr, uid, [int(id)], fields, context)[0]
|
res = Model.read(cr, uid, [int(id)], fields, context)[0]
|
||||||
|
if res.get('file_type'):
|
||||||
|
content_type = res['file_type']
|
||||||
else:
|
else:
|
||||||
res = Model.default_get(cr, uid, fields, context)
|
res = Model.default_get(cr, uid, fields, context)
|
||||||
filecontent = base64.b64decode(res.get(field) or '')
|
filecontent = base64.b64decode(res.get(field) or '')
|
||||||
|
@ -1100,7 +1104,7 @@ class Binary(http.Controller):
|
||||||
if filename_field:
|
if filename_field:
|
||||||
filename = res.get(filename_field, '') or filename
|
filename = res.get(filename_field, '') or filename
|
||||||
return request.make_response(filecontent,
|
return request.make_response(filecontent,
|
||||||
[('Content-Type', 'application/octet-stream'),
|
[('Content-Type', content_type),
|
||||||
('Content-Disposition', content_disposition(filename))])
|
('Content-Disposition', content_disposition(filename))])
|
||||||
|
|
||||||
@http.route('/web/binary/saveas_ajax', type='http', auth="public")
|
@http.route('/web/binary/saveas_ajax', type='http', auth="public")
|
||||||
|
@ -1113,6 +1117,7 @@ class Binary(http.Controller):
|
||||||
id = jdata.get('id', None)
|
id = jdata.get('id', None)
|
||||||
filename_field = jdata.get('filename_field', None)
|
filename_field = jdata.get('filename_field', None)
|
||||||
context = jdata.get('context', {})
|
context = jdata.get('context', {})
|
||||||
|
content_type = 'application/octet-stream'
|
||||||
|
|
||||||
Model = request.session.model(model)
|
Model = request.session.model(model)
|
||||||
fields = [field]
|
fields = [field]
|
||||||
|
@ -1121,7 +1126,10 @@ class Binary(http.Controller):
|
||||||
if data:
|
if data:
|
||||||
res = {field: data, filename_field: jdata.get('filename', None)}
|
res = {field: data, filename_field: jdata.get('filename', None)}
|
||||||
elif id:
|
elif id:
|
||||||
|
fields.append('file_type')
|
||||||
res = Model.read([int(id)], fields, context)[0]
|
res = Model.read([int(id)], fields, context)[0]
|
||||||
|
if res.get('file_type'):
|
||||||
|
content_type = res['file_type']
|
||||||
else:
|
else:
|
||||||
res = Model.default_get(fields, context)
|
res = Model.default_get(fields, context)
|
||||||
filecontent = base64.b64decode(res.get(field) or '')
|
filecontent = base64.b64decode(res.get(field) or '')
|
||||||
|
@ -1133,7 +1141,7 @@ class Binary(http.Controller):
|
||||||
if filename_field:
|
if filename_field:
|
||||||
filename = res.get(filename_field, '') or filename
|
filename = res.get(filename_field, '') or filename
|
||||||
return request.make_response(filecontent,
|
return request.make_response(filecontent,
|
||||||
headers=[('Content-Type', 'application/octet-stream'),
|
headers=[('Content-Type', content_type),
|
||||||
('Content-Disposition', content_disposition(filename))],
|
('Content-Disposition', content_disposition(filename))],
|
||||||
cookies={'fileToken': token})
|
cookies={'fileToken': token})
|
||||||
|
|
||||||
|
|
|
@ -896,7 +896,7 @@ html {
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 11px;
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
color: #333;
|
color: #333;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
|
@ -47,7 +47,8 @@ SLEEP_INTERVAL = 60 # 1 min
|
||||||
def memory_info(process):
|
def memory_info(process):
|
||||||
""" psutil < 2.0 does not have memory_info, >= 3.0 does not have
|
""" psutil < 2.0 does not have memory_info, >= 3.0 does not have
|
||||||
get_memory_info """
|
get_memory_info """
|
||||||
return (getattr(process, 'memory_info', None) or process.get_memory_info)()
|
pmem = (getattr(process, 'memory_info', None) or process.get_memory_info)()
|
||||||
|
return (pmem.rss, pmem.vms)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# Werkzeug WSGI servers patched
|
# Werkzeug WSGI servers patched
|
||||||
|
|
|
@ -183,7 +183,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)):
|
||||||
# generate the background color, past it as background
|
# generate the background color, past it as background
|
||||||
if randomize:
|
if randomize:
|
||||||
color = (randint(32, 224), randint(32, 224), randint(32, 224))
|
color = (randint(32, 224), randint(32, 224), randint(32, 224))
|
||||||
image.paste(color)
|
image.paste(color, box=(0, 0) + original.size)
|
||||||
image.paste(original, mask=original)
|
image.paste(original, mask=original)
|
||||||
# return the new image
|
# return the new image
|
||||||
buffer = StringIO.StringIO()
|
buffer = StringIO.StringIO()
|
||||||
|
|
Loading…
Reference in New Issue