Compare commits

...

14 Commits

Author SHA1 Message Date
Martin Trigaux b7789771f0 [FIX] tools: colorize image with pillow 4.0
Introduced by python-pillow/Pillow@c3fe5d43 and integrated into pillow 4.0
The size of the image is ignored and must be set using an image or a mask.

This patch is retrocompatible with the previous versions as the changed code was
in the box size computation. With this patch a 4 points box size is given so the
modified code is not executed.

Fixes #14927
2021-11-03 21:33:06 +01:00
Harald Welte 34f009a5ce HACK: disable super expensive query to get invoice total per supplier 2021-02-18 01:10:10 +01:00
Harald Welte efd655c0eb hr_timesheet_invoice: map accounts based on fiscal position of partner
Closes: SYS#3159
2021-02-17 16:42:50 +01:00
Harald Welte 59041f1780 hr_timesheet_invoice: Permit modification of invoiced timesheet lines
The existing code wouldn't even permit to remove the invoice association
in case the invoice is cancelled...
2020-12-10 17:37:33 +01:00
Stephen Medina 36ecb63f2c [FIX] support psutils >= 4.0 2019-06-03 18:21:25 +02:00
Harald Welte 447d3ec46e base_vat: Don't enforce leading zeroes in slovakian VAT numbers 2018-07-31 14:52:07 +00:00
Harald Welte 39180387a1 HACK: extend product.product name_search() for x_sysmo_barcode
This should be properly done in an extension, but was easier to add to
the core product.product code right now :/
2017-01-03 08:03:06 +01:00
Harald Welte d07b59d4ba barcode controller: Remove quiescence zone left and right
When creating reports with barcode labels, there is simply no space
for excessive quiescence zones.  Let's give control of layout to the
report template, not to the barcode renderer.
2017-01-02 15:04:14 +01:00
Harald Welte c077f64f57 bootstrap.css: Reduce default font size to 11px 2017-01-02 15:02:36 +01:00
Harald Welte bb57faa7cd SKR03: remove all accounts sysmocom doesn't need 2017-01-02 15:01:48 +01:00
Harald Welte 7c3f7945e0 hr_timesheet_data: disable cretaion of records
Not sure why this was needed, but it is present in our production odoo
2017-01-02 14:57:10 +01:00
Harald Welte eb0c93f6bb reports_shipping: comment out non-matching xpath expression
This needs investigation/fixing
2017-01-02 14:55:43 +01:00
Your Name d32d812812 Allow HR managers to modify even confirmed time sheets
This is particularly useful in case the "Invoicable" attribute
was not set correctly by the employee (who may even not know if
his work is invoicable to a customer or not)
2016-07-02 08:35:43 +00:00
EL HADJI DEM 7b0d707417 [IMP] web: better content-type for attachments
Add the corresponding content type document instead the default content type.
This allows browser to detect the type of file being downloaded.
Fixes #1225
2016-06-03 12:01:27 +00:00
13 changed files with 3285 additions and 8979 deletions

View File

@ -278,8 +278,10 @@ class res_partner(osv.osv):
# price_total is in the currency with rate = 1
# total_invoice should be displayed in the current user's currency
cr.execute(query, where_clause_params + [user_currency_id])
result[partner_id] = cr.fetchone()[0]
# HACK: Avoid super expensive query taking 290s, see https://projects.sysmocom.de/issues/5379
#cr.execute(query, where_clause_params + [user_currency_id])
#result[partner_id] = cr.fetchone()[0]
result[partner_id] = 0
return result

View File

@ -69,7 +69,7 @@ _ref_vat = {
'ro': 'RO1234567897',
'se': 'SE123456789701',
'si': 'SI12345679',
'sk': 'SK0012345675',
'sk': 'SK1234567898',
'tr': 'TR1234567890 (VERGINO) veya TR12345678901 (TCKIMLIKNO)' # Levent Karakas @ Eska Yazilim A.S.
}

View File

@ -8,6 +8,7 @@
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
</div>
</xpath>
<!--
<xpath expr="//th[@name='td_sched_date_h']" position="after">
<th t-if="o.picking_type_id.code == 'outgoing'"><strong>Carrier</strong></th>
<th><strong>Weight</strong></th>
@ -20,6 +21,7 @@
<span t-field="o.weight"/>
</td>
</xpath>
-->
</template>
</data>
</openerp>

View File

@ -2,6 +2,7 @@
<openerp>
<data noupdate="1">
<!--
<record id="analytic_journal" model="account.analytic.journal">
<field name="code">TS</field>
<field name="name">Timesheet Journal</field>
@ -15,6 +16,6 @@
<record id="product.product_product_consultant" model="product.product">
<field name="sale_ok">True</field>
</record>
-->
</data>
</openerp>

View File

@ -126,7 +126,7 @@ class account_analytic_line(osv.osv):
}
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,
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
if not general_account:
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
tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes, context=context)
curr_invoice_line.update({

View File

@ -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)]}),
'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)]}),
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'sheet_id',
'Timesheet lines',
readonly=True, states={
'draft': [('readonly', False)],
'new': [('readonly', False)]}
),
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'sheet_id', 'Timesheet lines'),
'attendances_ids' : fields.one2many('hr.attendance', 'sheet_id', 'Attendances'),
'state' : fields.selection([
('new', 'New'),
@ -332,8 +327,7 @@ class hr_timesheet_line(osv.osv):
for ts_line in self.browse(cursor, user, ids, context=context):
sheet_ids = sheet_obj.search(cursor, user,
[('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date),
('employee_id.user_id', '=', ts_line.user_id.id),
('state', 'in', ['draft', 'new'])],
('employee_id.user_id', '=', ts_line.user_id.id)],
context=context)
if sheet_ids:
# [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):
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.'))
return True
@ -531,7 +525,7 @@ class hr_attendance(osv.osv):
def _check(self, 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'))
return True

File diff suppressed because it is too large Load Diff

View File

@ -1130,6 +1130,8 @@ class product_product(osv.osv):
ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context)
if not ids:
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:
# 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

View File

@ -89,7 +89,7 @@ class ReportController(Controller):
width, height, humanreadable = int(width), int(height), bool(humanreadable)
barcode = createBarcodeDrawing(
type, value=value, format='png', width=width, height=height,
humanReadable = humanreadable
humanReadable = humanreadable, quiet=0
)
barcode = barcode.asString('png')
except (ValueError, AttributeError):

View File

@ -1086,10 +1086,14 @@ class Binary(http.Controller):
Model = request.registry[model]
cr, uid, context = request.cr, request.uid, request.context
fields = [field]
content_type = 'application/octet-stream'
if filename_field:
fields.append(filename_field)
if id:
fields.append('file_type')
res = Model.read(cr, uid, [int(id)], fields, context)[0]
if res.get('file_type'):
content_type = res['file_type']
else:
res = Model.default_get(cr, uid, fields, context)
filecontent = base64.b64decode(res.get(field) or '')
@ -1100,7 +1104,7 @@ class Binary(http.Controller):
if filename_field:
filename = res.get(filename_field, '') or filename
return request.make_response(filecontent,
[('Content-Type', 'application/octet-stream'),
[('Content-Type', content_type),
('Content-Disposition', content_disposition(filename))])
@http.route('/web/binary/saveas_ajax', type='http', auth="public")
@ -1113,6 +1117,7 @@ class Binary(http.Controller):
id = jdata.get('id', None)
filename_field = jdata.get('filename_field', None)
context = jdata.get('context', {})
content_type = 'application/octet-stream'
Model = request.session.model(model)
fields = [field]
@ -1121,7 +1126,10 @@ class Binary(http.Controller):
if data:
res = {field: data, filename_field: jdata.get('filename', None)}
elif id:
fields.append('file_type')
res = Model.read([int(id)], fields, context)[0]
if res.get('file_type'):
content_type = res['file_type']
else:
res = Model.default_get(fields, context)
filecontent = base64.b64decode(res.get(field) or '')
@ -1133,7 +1141,7 @@ class Binary(http.Controller):
if filename_field:
filename = res.get(filename_field, '') or filename
return request.make_response(filecontent,
headers=[('Content-Type', 'application/octet-stream'),
headers=[('Content-Type', content_type),
('Content-Disposition', content_disposition(filename))],
cookies={'fileToken': token})

View File

@ -896,7 +896,7 @@ html {
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-size: 11px;
line-height: 1.42857143;
color: #333;
background-color: #fff;

View File

@ -47,7 +47,8 @@ SLEEP_INTERVAL = 60 # 1 min
def memory_info(process):
""" psutil < 2.0 does not have memory_info, >= 3.0 does not have
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

View File

@ -183,7 +183,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)):
# generate the background color, past it as background
if randomize:
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)
# return the new image
buffer = StringIO.StringIO()