[MERGE] trunk-website-al
bzr revid: ddm@openerp.com-20131004094409-eueito4aochzvmk4
This commit is contained in:
@@ -1416,14 +1416,17 @@ class account_move(osv.osv):
|
||||
l[2]['period_id'] = default_period
|
||||
context['period_id'] = default_period
|
||||
|
||||
if 'line_id' in vals:
|
||||
if vals.get('line_id', False):
|
||||
c = context.copy()
|
||||
c['novalidate'] = True
|
||||
c['period_id'] = vals['period_id'] if 'period_id' in vals else self._get_period(cr, uid, context)
|
||||
c['journal_id'] = vals['journal_id']
|
||||
if 'date' in vals: c['date'] = vals['date']
|
||||
result = super(account_move, self).create(cr, uid, vals, c)
|
||||
self.validate(cr, uid, [result], context)
|
||||
tmp = self.validate(cr, uid, [result], context)
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context)
|
||||
if journal.entry_posted and tmp:
|
||||
self.button_validate(cr,uid, [result], context)
|
||||
else:
|
||||
result = super(account_move, self).create(cr, uid, vals, context)
|
||||
return result
|
||||
|
||||
@@ -349,6 +349,7 @@
|
||||
<page string="Invoice Lines">
|
||||
<field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
|
||||
<tree string="Invoice Lines" editable="bottom">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="product_id"
|
||||
on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field name="name"/>
|
||||
|
||||
@@ -1283,7 +1283,7 @@ class account_move_line(osv.osv):
|
||||
self.create(cr, uid, data, context)
|
||||
del vals['account_tax_id']
|
||||
|
||||
if check and ((not context.get('no_store_function')) or journal.entry_posted):
|
||||
if check and not context.get('novalidate') and ((not context.get('no_store_function')) or journal.entry_posted):
|
||||
tmp = move_obj.validate(cr, uid, [vals['move_id']], context)
|
||||
if journal.entry_posted and tmp:
|
||||
move_obj.button_validate(cr,uid, [vals['move_id']], context)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Accountant'
|
||||
-
|
||||
!record {model: res.users, id: res_users_account_user}:
|
||||
!record {model: res.users, id: res_users_account_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Accountant
|
||||
login: acc
|
||||
@@ -17,7 +17,7 @@
|
||||
-
|
||||
Create a user as 'Financial Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_account_manager}:
|
||||
!record {model: res.users, id: res_users_account_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Financial Manager
|
||||
login: fm
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<newline/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='filter']" position="replace">
|
||||
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4"/>
|
||||
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)"/>
|
||||
<field name="initial_balance" attrs="{'readonly':[('filter', 'in', ('filter_no', 'unreconciled'))]}" />
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -655,7 +655,7 @@ class account_analytic_account(osv.osv):
|
||||
if not contract.partner_id:
|
||||
raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name )
|
||||
|
||||
fpos = contract.partner_id.property_account_position.id or False
|
||||
fpos = contract.partner_id.property_account_position or False
|
||||
journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', contract.company_id.id or False)], limit=1)
|
||||
if not journal_ids:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
@@ -673,7 +673,7 @@ class account_analytic_account(osv.osv):
|
||||
'journal_id': len(journal_ids) and journal_ids[0] or False,
|
||||
'date_invoice': contract.recurring_next_date,
|
||||
'origin': contract.name,
|
||||
'fiscal_position': fpos,
|
||||
'fiscal_position': fpos and fpos.id,
|
||||
'payment_term': partner_payment_term,
|
||||
'company_id': contract.company_id.id or False,
|
||||
}
|
||||
@@ -687,7 +687,7 @@ class account_analytic_account(osv.osv):
|
||||
account_id = res.categ_id.property_account_income_categ.id
|
||||
account_id = fpos_obj.map_account(cr, uid, fpos, account_id)
|
||||
|
||||
taxes = res.taxes_id and res.taxes_id or False
|
||||
taxes = res.taxes_id or False
|
||||
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
invoice_line_vals = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Accountant for account voucher'
|
||||
-
|
||||
!record {model: res.users, id: res_users_account_voucher_user}:
|
||||
!record {model: res.users, id: res_users_account_voucher_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Voucher Accountant
|
||||
login: vacc
|
||||
@@ -17,7 +17,7 @@
|
||||
-
|
||||
Create a user as 'Financial Manager for account voucher'
|
||||
-
|
||||
!record {model: res.users, id: res_users_account_voucher_manager}:
|
||||
!record {model: res.users, id: res_users_account_voucher_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Financial Manager for voucher
|
||||
login: fmv
|
||||
|
||||
@@ -1208,20 +1208,44 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
||||
new_rrule_str = ';'.join(new_rrule_str)
|
||||
rdates = get_recurrent_dates(str(new_rrule_str), exdate, event_date, data['exrule'])
|
||||
for r_date in rdates:
|
||||
ok = True
|
||||
# fix domain evaluation
|
||||
# step 1: check date and replace expression by True or False, replace other expressions by True
|
||||
# step 2: evaluation of & and |
|
||||
# check if there are one False
|
||||
pile = []
|
||||
for arg in domain:
|
||||
if arg[0] in ('date', 'date_deadline'):
|
||||
if (arg[1]=='='):
|
||||
ok = ok and r_date.strftime('%Y-%m-%d')==arg[2]
|
||||
if (arg[1]=='>'):
|
||||
ok = ok and r_date.strftime('%Y-%m-%d')>arg[2]
|
||||
if (arg[1]=='<'):
|
||||
ok = ok and r_date.strftime('%Y-%m-%d')<arg[2]
|
||||
if (arg[1]=='>='):
|
||||
ok = ok and r_date.strftime('%Y-%m-%d')>=arg[2]
|
||||
if (arg[1]=='<='):
|
||||
ok = ok and r_date.strftime('%Y-%m-%d')<=arg[2]
|
||||
if not ok:
|
||||
if str(arg[0]) in (str('date'), str('date_deadline')):
|
||||
if (arg[1] == '='):
|
||||
ok = r_date.strftime('%Y-%m-%d')==arg[2]
|
||||
if (arg[1] == '>'):
|
||||
ok = r_date.strftime('%Y-%m-%d')>arg[2]
|
||||
if (arg[1] == '<'):
|
||||
ok = r_date.strftime('%Y-%m-%d')<arg[2]
|
||||
if (arg[1] == '>='):
|
||||
ok = r_date.strftime('%Y-%m-%d')>=arg[2]
|
||||
if (arg[1] == '<='):
|
||||
ok = r_date.strftime('%Y-%m-%d')<=arg[2]
|
||||
pile.append(ok)
|
||||
elif str(arg) == str('&') or str(arg) == str('|'):
|
||||
pile.append(arg)
|
||||
else:
|
||||
pile.append(True)
|
||||
pile.reverse()
|
||||
new_pile = []
|
||||
for item in pile:
|
||||
if not isinstance(item, basestring):
|
||||
res = item
|
||||
elif str(item) == str('&'):
|
||||
first = new_pile.pop()
|
||||
second = new_pile.pop()
|
||||
res = first and second
|
||||
elif str(item) == str('|'):
|
||||
first = new_pile.pop()
|
||||
second = new_pile.pop()
|
||||
res = first or second
|
||||
new_pile.append(res)
|
||||
|
||||
if [True for item in new_pile if not item]:
|
||||
continue
|
||||
idval = real_id2base_calendar_id(data['id'], r_date.strftime("%Y-%m-%d %H:%M:%S"))
|
||||
result.append(idval)
|
||||
@@ -1346,18 +1370,17 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
||||
|
||||
for arg in args:
|
||||
new_arg = arg
|
||||
if arg[0] in ('date', unicode('date'), 'date_deadline', unicode('date_deadline')):
|
||||
if arg[0] in ('date_deadline', unicode('date_deadline')):
|
||||
if context.get('virtual_id', True):
|
||||
new_args += ['|','&',('recurrency','=',1),('recurrent_id_date', arg[1], arg[2])]
|
||||
new_args += ['|','&',('recurrency','=',1),('end_date', arg[1], arg[2])]
|
||||
elif arg[0] == "id":
|
||||
new_id = get_real_ids(arg[2])
|
||||
new_arg = (arg[0], arg[1], new_id)
|
||||
new_args.append(new_arg)
|
||||
|
||||
#offset, limit and count must be treated separately as we may need to deal with virtual ids
|
||||
res = super(calendar_event, self).search(cr, uid, new_args, offset=0, limit=0, order=order, context=context, count=False)
|
||||
if context.get('virtual_id', True):
|
||||
res = self.get_recurrent_ids(cr, uid, res, new_args, limit, context=context)
|
||||
res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context)
|
||||
if count:
|
||||
return len(res)
|
||||
elif limit:
|
||||
@@ -1436,6 +1459,14 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
||||
vals['vtimezone'] = vals['vtimezone'][40:]
|
||||
|
||||
res = super(calendar_event, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
# set end_date for calendar searching
|
||||
if vals.get('recurrency', True) and vals.get('end_type', 'count') in ('count', unicode('count')) and \
|
||||
(vals.get('rrule_type') or vals.get('count') or vals.get('date') or vals.get('date_deadline')):
|
||||
for data in self.read(cr, uid, ids, ['date', 'date_deadline', 'recurrency', 'rrule_type', 'count', 'end_type'], context=context):
|
||||
end_date = self._set_recurrency_end_date(data, context=context)
|
||||
super(calendar_event, self).write(cr, uid, [data['id']], {'end_date': end_date}, context=context)
|
||||
|
||||
if vals.get('partner_ids', False):
|
||||
self.create_attendees(cr, uid, ids, context)
|
||||
|
||||
@@ -1554,6 +1585,21 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
||||
self.unlink_events(cr, uid, ids, context=context)
|
||||
return res
|
||||
|
||||
def _set_recurrency_end_date(self, data, context=None):
|
||||
end_date = data.get('end_date')
|
||||
if data.get('recurrency') and data.get('end_type') in ('count', unicode('count')):
|
||||
data_date_deadline = datetime.strptime(data.get('date_deadline'), '%Y-%m-%d %H:%M:%S')
|
||||
if data.get('rrule_type') in ('daily', unicode('count')):
|
||||
rel_date = relativedelta(days=data.get('count')+1)
|
||||
elif data.get('rrule_type') in ('weekly', unicode('weekly')):
|
||||
rel_date = relativedelta(days=(data.get('count')+1)*7)
|
||||
elif data.get('rrule_type') in ('monthly', unicode('monthly')):
|
||||
rel_date = relativedelta(months=data.get('count')+1)
|
||||
elif data.get('rrule_type') in ('yearly', unicode('yearly')):
|
||||
rel_date = relativedelta(years=data.get('count')+1)
|
||||
end_date = data_date_deadline + rel_date
|
||||
return end_date
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -1561,7 +1607,9 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
||||
if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
|
||||
vals['vtimezone'] = vals['vtimezone'][40:]
|
||||
|
||||
vals['end_date'] = self._set_recurrency_end_date(vals, context=context)
|
||||
res = super(calendar_event, self).create(cr, uid, vals, context)
|
||||
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
|
||||
self.create_attendees(cr, uid, [res], context)
|
||||
|
||||
@@ -20,10 +20,16 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
import re
|
||||
from openerp.report.render.rml2pdf import customfonts
|
||||
|
||||
class base_config_settings(osv.osv_memory):
|
||||
_name = 'base.config.settings'
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
def _get_font(self, cr, uid, context=None):
|
||||
return sorted(customfonts.RegisterCustomFonts())
|
||||
|
||||
_columns = {
|
||||
'module_multi_company': fields.boolean('Manage multiple companies',
|
||||
help='Work in multi-company environments, with appropriate security access between companies.\n'
|
||||
@@ -38,8 +44,13 @@ class base_config_settings(osv.osv_memory):
|
||||
'module_base_import': fields.boolean("Allow users to import data from CSV files"),
|
||||
'module_google_drive': fields.boolean('Attach Google documents to any record',
|
||||
help="""This installs the module google_docs."""),
|
||||
'font': fields.selection(_get_font, "Select Font", help="Set the font into the report header, will be used for every RML report of the user company"),
|
||||
}
|
||||
|
||||
|
||||
_defaults= {
|
||||
'font': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.font or 'Helvetica',
|
||||
}
|
||||
|
||||
def open_company(self, cr, uid, ids, context=None):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
||||
return {
|
||||
@@ -52,6 +63,20 @@ class base_config_settings(osv.osv_memory):
|
||||
'target': 'current',
|
||||
}
|
||||
|
||||
def _change_header(self, header,font):
|
||||
""" Replace default fontname use in header and setfont tag """
|
||||
|
||||
default_para = re.sub('fontName.?=.?".*"', 'fontName="%s"'% font,header)
|
||||
return re.sub('(<setFont.?name.?=.?)(".*?")(.)', '\g<1>"%s"\g<3>'% font,default_para)
|
||||
|
||||
def set_base_defaults(self, cr, uid, ids, context=None):
|
||||
ir_model_data = self.pool.get('ir.model.data')
|
||||
wizard = self.browse(cr, uid, ids)[0]
|
||||
if wizard.font:
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
||||
user.company_id.write({'font':wizard.font,'rml_header': self._change_header(user.company_id.rml_header,wizard.font), 'rml_header2': self._change_header(user.company_id.rml_header2,wizard.font), 'rml_header3': self._change_header(user.company_id.rml_header3,wizard.font)})
|
||||
return {}
|
||||
|
||||
# Preferences wizard for Sales & CRM.
|
||||
# It is defined here because it is inherited independently in modules sale, crm,
|
||||
# plugin_outlook and plugin_thunderbird.
|
||||
@@ -80,4 +105,4 @@ class sale_config_settings(osv.osv_memory):
|
||||
help='Get access to statistics with your mass mailing, manage campaigns.'),
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -90,6 +90,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Report Settings">
|
||||
<label for="font" string="RML font (Header/footer)" />
|
||||
<div>
|
||||
<div>
|
||||
<field name="font" class="oe_inline"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
+9
-6
@@ -19,6 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import calendar
|
||||
from datetime import date, datetime
|
||||
from dateutil import relativedelta
|
||||
|
||||
@@ -117,9 +118,9 @@ class crm_case_section(osv.osv):
|
||||
"""
|
||||
month_begin = date.today().replace(day=1)
|
||||
section_result = [{
|
||||
'value': 0,
|
||||
'tooltip': (month_begin + relativedelta.relativedelta(months=-i)).strftime('%B'),
|
||||
} for i in range(self._period_number - 1, -1, -1)]
|
||||
'value': 0,
|
||||
'tooltip': (month_begin + relativedelta.relativedelta(months=-i)).strftime('%B'),
|
||||
} for i in range(self._period_number - 1, -1, -1)]
|
||||
group_obj = obj.read_group(cr, uid, domain, read_fields, groupby_field, context=context)
|
||||
for group in group_obj:
|
||||
group_begin_date = datetime.strptime(group['__domain'][0][2], tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
@@ -135,12 +136,14 @@ class crm_case_section(osv.osv):
|
||||
obj = self.pool.get('crm.lead')
|
||||
res = dict.fromkeys(ids, False)
|
||||
month_begin = date.today().replace(day=1)
|
||||
groupby_begin = (month_begin + relativedelta.relativedelta(months=-4)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
date_begin = month_begin - relativedelta.relativedelta(months=self._period_number - 1)
|
||||
date_end = month_begin.replace(day=calendar.monthrange(month_begin.year, month_begin.month)[1])
|
||||
date_domain = [('create_date', '>=', date_begin.strftime(tools.DEFAULT_SERVER_DATE_FORMAT)), ('create_date', '<=', date_end.strftime(tools.DEFAULT_SERVER_DATE_FORMAT))]
|
||||
for id in ids:
|
||||
res[id] = dict()
|
||||
lead_domain = [('type', '=', 'lead'), ('section_id', '=', id), ('create_date', '>=', groupby_begin)]
|
||||
lead_domain = date_domain + [('type', '=', 'lead'), ('section_id', '=', id)]
|
||||
res[id]['monthly_open_leads'] = self.__get_bar_values(cr, uid, obj, lead_domain, ['create_date'], 'create_date_count', 'create_date', context=context)
|
||||
opp_domain = [('type', '=', 'opportunity'), ('section_id', '=', id), ('create_date', '>=', groupby_begin)]
|
||||
opp_domain = date_domain + [('type', '=', 'opportunity'), ('section_id', '=', id)]
|
||||
res[id]['monthly_planned_revenue'] = self.__get_bar_values(cr, uid, obj, opp_domain, ['planned_revenue', 'create_date'], 'planned_revenue', 'create_date', context=context)
|
||||
return res
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Crm Salesmanager'
|
||||
-
|
||||
!record {model: res.users, id: crm_res_users_salesmanager}:
|
||||
!record {model: res.users, id: crm_res_users_salesmanager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Crm Sales manager
|
||||
login: csm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Crm Salesman'
|
||||
-
|
||||
!record {model: res.users, id: crm_res_users_salesman}:
|
||||
!record {model: res.users, id: crm_res_users_salesman, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Crm Salesman
|
||||
login: csu
|
||||
|
||||
@@ -63,7 +63,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||
for id in ids:
|
||||
tomerge.add(id)
|
||||
if email:
|
||||
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0]), ('probability', '<', '100')])
|
||||
ids = lead_obj.search(cr, uid, [('email_from', '=ilike', email[0]), ('probability', '<', '100')])
|
||||
for id in ids:
|
||||
tomerge.add(id)
|
||||
|
||||
|
||||
@@ -33,48 +33,45 @@ class actions_server(osv.Model):
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'email_from': fields.char('From',
|
||||
help="Sender address; define the template to see its value. If not set, the default "
|
||||
"value will be the author's email alias if configured, or email address."),
|
||||
'email_to': fields.char('To (Emails)',
|
||||
help="Comma-separated recipient addresses; define the template to see its value"),
|
||||
'partner_to': fields.char('To (Partners)',
|
||||
help="Comma-separated ids of recipient partners; define the template to see its value"),
|
||||
'subject': fields.char('Subject',
|
||||
help="Email subject; define the template to see its value"),
|
||||
'body_html': fields.text('Body',
|
||||
help="Rich-text/HTML version of the message; define the template to see its value"),
|
||||
'template_id': fields.many2one('email.template', 'Email Template', ondelete='set null',
|
||||
help="Define the email template to use for the email to send.")
|
||||
'email_from': fields.related(
|
||||
'template_id', 'email_from', type='char',
|
||||
readonly=True, string='From'
|
||||
),
|
||||
'email_to': fields.related(
|
||||
'template_id', 'email_to', type='char',
|
||||
readonly=True, string='To (Emails)'
|
||||
),
|
||||
'partner_to': fields.related(
|
||||
'template_id', 'partner_to', type='char',
|
||||
readonly=True, string='To (Partners)'
|
||||
),
|
||||
'subject': fields.related(
|
||||
'template_id', 'subject', type='char',
|
||||
readonly=True, string='Subject'
|
||||
),
|
||||
'body_html': fields.related(
|
||||
'template_id', 'body_html', type='text',
|
||||
readonly=True, string='Body'
|
||||
),
|
||||
'template_id': fields.many2one(
|
||||
'email.template', 'Email Template', ondelete='set null',
|
||||
domain="[('model_id', '=', model_id)]",
|
||||
),
|
||||
}
|
||||
|
||||
def on_change_template_id(self, cr, uid, ids, template_id, context=None):
|
||||
""" Render the raw template in the server action fields. """
|
||||
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to']
|
||||
if template_id:
|
||||
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
|
||||
template_values = self.pool.get('email.template').read(cr, uid, template_id, fields, context)
|
||||
values = dict((field, template_values[field]) for field in fields if template_values.get(field))
|
||||
if not values.get('email_from'):
|
||||
return {'warning': {'title': 'Incomplete template', 'message': 'Your template should define email_from'}, 'value': values}
|
||||
else:
|
||||
values = self.default_get(cr, uid, ['subject', 'body_html', 'email_from', 'email_to', 'partner_to'], context=context)
|
||||
values = dict.fromkeys(fields, False)
|
||||
|
||||
return {'value': values}
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
if values.get('template_id'):
|
||||
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
|
||||
template_values = self.pool.get('email.template').read(cr, uid, values.get('template_id'), fields, context)
|
||||
values.update(dict((field, template_values[field]) for field in fields if template_values.get(field)))
|
||||
return super(actions_server, self).create(cr, uid, values, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
if values.get('template_id'):
|
||||
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
|
||||
template_values = self.pool.get('email.template').read(cr, uid, values.get('template_id'), fields, context)
|
||||
values.update(dict((field, template_values[field]) for field in fields if template_values.get(field)))
|
||||
return super(actions_server, self).write(cr, uid, ids, values, context=context)
|
||||
|
||||
def run_action_email(self, cr, uid, action, eval_context=None, context=None):
|
||||
if not action.template_id or not context.get('active_id'):
|
||||
return False
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<group attrs="{'invisible': [('model_id', '=', False)]}">
|
||||
<field name="template_id"
|
||||
on_change='on_change_template_id(template_id)'
|
||||
domain="[('model_id', '=', model_id)]"
|
||||
attrs="{'required': [('state', '=', 'email')]}"/>
|
||||
<p colspan="2" attrs="{'invisible': [('template_id', '!=', False)]}">
|
||||
Choose a template to display its values.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Event manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_eventmanager}:
|
||||
!record {model: res.users, id: res_users_eventmanager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Event manager
|
||||
login: em
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Event user'
|
||||
-
|
||||
!record {model: res.users, id: res_users_eventuser}:
|
||||
!record {model: res.users, id: res_users_eventuser, view: False}:
|
||||
company_id: base.main_company
|
||||
name: User
|
||||
login: eu
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'HR Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_hr_manager}:
|
||||
!record {model: res.users, id: res_users_hr_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR manager
|
||||
login: hrm
|
||||
@@ -15,7 +15,7 @@
|
||||
-
|
||||
Create a user as 'HR Officer'
|
||||
-
|
||||
!record {model: res.users, id: res_users_hr_officer}:
|
||||
!record {model: res.users, id: res_users_hr_officer, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR Officer
|
||||
login: hro
|
||||
@@ -29,7 +29,7 @@
|
||||
-
|
||||
Create a user as 'Employee'
|
||||
-
|
||||
!record {model: res.users, id: res_users_employee}:
|
||||
!record {model: res.users, id: res_users_employee, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Employee
|
||||
login: emp
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'HR Attendance Officer'
|
||||
-
|
||||
!record {model: res.users, id: res_users_attendance_officer}:
|
||||
!record {model: res.users, id: res_users_attendance_officer, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR Officer
|
||||
login: ao
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'HR Recruitment Officer'
|
||||
-
|
||||
!record {model: res.users, id: res_users_hr_recruitment_officer}:
|
||||
!record {model: res.users, id: res_users_hr_recruitment_officer, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR Recruitment Officer
|
||||
login: hrro
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'HR timesheet Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_hr_timesheet_manager}:
|
||||
!record {model: res.users, id: res_hr_timesheet_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR timesheet manager
|
||||
login: hrtm
|
||||
@@ -15,7 +15,7 @@
|
||||
-
|
||||
Create a user as 'HR timesheet Officer'
|
||||
-
|
||||
!record {model: res.users, id: res_hr_timesheet_officer}:
|
||||
!record {model: res.users, id: res_hr_timesheet_officer, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR timesheet Officer
|
||||
login: hrto
|
||||
@@ -29,7 +29,7 @@
|
||||
-
|
||||
Create a user as 'Timesheet Employee'
|
||||
-
|
||||
!record {model: res.users, id: res_hr_timesheet_employee}:
|
||||
!record {model: res.users, id: res_hr_timesheet_employee, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Timesheet Employee
|
||||
login: empt
|
||||
|
||||
@@ -458,7 +458,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv):
|
||||
THEN (SUM(total_attendance) +
|
||||
CASE WHEN current_date <> name
|
||||
THEN 1440
|
||||
ELSE (EXTRACT(hour FROM current_time) * 60) + EXTRACT(minute FROM current_time)
|
||||
ELSE (EXTRACT(hour FROM current_time AT TIME ZONE 'UTC') * 60) + EXTRACT(minute FROM current_time AT TIME ZONE 'UTC')
|
||||
END
|
||||
)
|
||||
ELSE SUM(total_attendance)
|
||||
|
||||
@@ -1217,7 +1217,7 @@ openerp.mail = function (session) {
|
||||
init: function (parent, datasets, options) {
|
||||
var self = this;
|
||||
this._super(parent, options);
|
||||
this.MailWidget = parent.__proto__ == mail.Widget.prototype ? parent : false;
|
||||
this.MailWidget = parent instanceof mail.Widget ? parent : false;
|
||||
this.domain = options.domain || [];
|
||||
this.context = _.extend(options.context || {});
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ openerp.mail.suggestions = function(session, mail) {
|
||||
|
||||
join_group: function (event) {
|
||||
var self = this;
|
||||
return this.mail_group.call('message_subscribe_users', [[$(event.currentTarget).attr('id')],[this.session.uid]]).then(function(res) {
|
||||
var group_id = parseInt($(event.currentTarget).attr('id'), 10);
|
||||
return this.mail_group.call('message_subscribe_users', [[group_id], [this.session.uid]]).then(function(res) {
|
||||
self.fetch_suggested_groups();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -194,10 +194,13 @@ class MassMailing(osv.Model):
|
||||
}
|
||||
for id in ids:
|
||||
res[id] = {}
|
||||
date_begin = self.browse(cr, uid, id, context=context).date
|
||||
domain = [('mass_mailing_id', '=', id), ('opened', '>=', date_begin)]
|
||||
date_begin = datetime.strptime(self.browse(cr, uid, id, context=context).date, tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
date_end = date_begin + relativedelta.relativedelta(days=self._period_number - 1)
|
||||
date_begin_str = date_begin.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
date_end_str = date_end.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
domain = [('mass_mailing_id', '=', id), ('opened', '>=', date_begin_str), ('opened', '<=', date_end_str)]
|
||||
res[id]['opened_monthly'] = self.__get_bar_values(cr, uid, id, obj, domain, ['opened'], 'opened_count', 'opened', context=context)
|
||||
domain = [('mass_mailing_id', '=', id), ('replied', '>=', date_begin)]
|
||||
domain = [('mass_mailing_id', '=', id), ('replied', '>=', date_begin_str), ('replied', '<=', date_end_str)]
|
||||
res[id]['replied_monthly'] = self.__get_bar_values(cr, uid, id, obj, domain, ['replied'], 'replied_count', 'replied', context=context)
|
||||
return res
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ Dashboard / Reports for MRP will include:
|
||||
#TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company
|
||||
# so the ymls are too complex to change at this stage
|
||||
'test': [
|
||||
'test/bom_with_service_type_product.yml',
|
||||
'test/mrp_users.yml',
|
||||
'test/order_demo.yml',
|
||||
'test/order_process.yml',
|
||||
|
||||
+60
-27
@@ -292,8 +292,10 @@ class mrp_bom(osv.osv):
|
||||
"""
|
||||
if properties is None:
|
||||
properties = []
|
||||
cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
domain = [('product_id', '=', product_id), ('bom_id', '=', False),
|
||||
'|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)),
|
||||
'|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))]
|
||||
ids = self.search(cr, uid, domain)
|
||||
max_prop = 0
|
||||
result = False
|
||||
for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):
|
||||
@@ -601,12 +603,12 @@ class mrp_production(osv.osv):
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state': 'picking_except'})
|
||||
return True
|
||||
|
||||
def action_compute(self, cr, uid, ids, properties=None, context=None):
|
||||
""" Computes bills of material of a product.
|
||||
@param properties: List containing dictionaries of properties.
|
||||
@return: No. of products.
|
||||
|
||||
def _action_compute_lines(self, cr, uid, ids, properties=None, context=None):
|
||||
""" Compute product_lines and workcenter_lines from BoM structure
|
||||
@return: product_lines
|
||||
"""
|
||||
|
||||
if properties is None:
|
||||
properties = []
|
||||
results = []
|
||||
@@ -614,13 +616,15 @@ class mrp_production(osv.osv):
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
prod_line_obj = self.pool.get('mrp.production.product.line')
|
||||
workcenter_line_obj = self.pool.get('mrp.production.workcenter.line')
|
||||
for production in self.browse(cr, uid, ids):
|
||||
|
||||
p_ids = prod_line_obj.search(cr, SUPERUSER_ID, [('production_id', '=', production.id)], context=context)
|
||||
prod_line_obj.unlink(cr, SUPERUSER_ID, p_ids, context=context)
|
||||
w_ids = workcenter_line_obj.search(cr, SUPERUSER_ID, [('production_id', '=', production.id)], context=context)
|
||||
workcenter_line_obj.unlink(cr, SUPERUSER_ID, w_ids, context=context)
|
||||
|
||||
for production in self.browse(cr, uid, ids, context=context):
|
||||
#unlink product_lines
|
||||
prod_line_obj.unlink(cr, SUPERUSER_ID, [line.id for line in production.product_lines], context=context)
|
||||
|
||||
#unlink workcenter_lines
|
||||
workcenter_line_obj.unlink(cr, SUPERUSER_ID, [line.id for line in production.workcenter_lines], context=context)
|
||||
|
||||
# search BoM structure and route
|
||||
bom_point = production.bom_id
|
||||
bom_id = production.bom_id.id
|
||||
if not bom_point:
|
||||
@@ -629,20 +633,33 @@ class mrp_production(osv.osv):
|
||||
bom_point = bom_obj.browse(cr, uid, bom_id)
|
||||
routing_id = bom_point.routing_id.id or False
|
||||
self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
|
||||
|
||||
|
||||
if not bom_id:
|
||||
raise osv.except_osv(_('Error!'), _("Cannot find a bill of material for this product."))
|
||||
|
||||
# get components and workcenter_lines from BoM structure
|
||||
factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
|
||||
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties, routing_id=production.routing_id.id)
|
||||
results = res[0]
|
||||
results2 = res[1]
|
||||
results = res[0] # product_lines
|
||||
results2 = res[1] # workcenter_lines
|
||||
|
||||
# reset product_lines in production order
|
||||
for line in results:
|
||||
line['production_id'] = production.id
|
||||
prod_line_obj.create(cr, uid, line)
|
||||
|
||||
#reset workcenter_lines in production order
|
||||
for line in results2:
|
||||
line['production_id'] = production.id
|
||||
workcenter_line_obj.create(cr, uid, line)
|
||||
return len(results)
|
||||
return results
|
||||
|
||||
def action_compute(self, cr, uid, ids, properties=None, context=None):
|
||||
""" Computes bills of material of a product.
|
||||
@param properties: List containing dictionaries of properties.
|
||||
@return: No. of products.
|
||||
"""
|
||||
return len(self._action_compute_lines(cr, uid, ids, properties=properties, context=context))
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
""" Cancels the production order and related stock moves.
|
||||
@@ -669,8 +686,12 @@ class mrp_production(osv.osv):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
self.write(cr, uid, ids, {'state': 'ready'})
|
||||
|
||||
for (production_id,name) in self.name_get(cr, uid, ids):
|
||||
production = self.browse(cr, uid, production_id)
|
||||
for production in self.browse(cr, uid, ids, context=context):
|
||||
if not production.move_created_ids:
|
||||
produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
|
||||
for scheduled in production.product_lines:
|
||||
self._make_production_line_procurement(cr, uid, scheduled, False, context=context)
|
||||
|
||||
if production.move_prod_id and production.move_prod_id.location_id.id != production.location_dest_id.id:
|
||||
move_obj.write(cr, uid, [production.move_prod_id.id],
|
||||
{'location_id': production.location_dest_id.id})
|
||||
@@ -722,6 +743,10 @@ class mrp_production(osv.osv):
|
||||
stock_mov_obj = self.pool.get('stock.move')
|
||||
production = self.browse(cr, uid, production_id, context=context)
|
||||
|
||||
if not production.move_lines and production.state == 'ready':
|
||||
# trigger workflow if not products to consume (eg: services)
|
||||
self.signal_button_produce(cr, uid, [production_id])
|
||||
|
||||
produced_qty = 0
|
||||
for produced_product in production.move_created_ids2:
|
||||
if (produced_product.scrapped) or (produced_product.product_id.id != production.product_id.id):
|
||||
@@ -784,9 +809,9 @@ class mrp_production(osv.osv):
|
||||
subproduct_factor = self._get_subproduct_factor(cr, uid, production.id, produce_product.id, context=context)
|
||||
rest_qty = (subproduct_factor * production.product_qty) - produced_qty
|
||||
|
||||
if rest_qty < production_qty:
|
||||
if rest_qty < (subproduct_factor * production_qty):
|
||||
prod_name = produce_product.product_id.name_get()[0][1]
|
||||
raise osv.except_osv(_('Warning!'), _('You are going to produce total %s quantities of "%s".\nBut you can only produce up to total %s quantities.') % (production_qty, prod_name, rest_qty))
|
||||
raise osv.except_osv(_('Warning!'), _('You are going to produce total %s quantities of "%s".\nBut you can only produce up to total %s quantities.') % ((subproduct_factor * production_qty), prod_name, rest_qty))
|
||||
if rest_qty > 0 :
|
||||
stock_mov_obj.action_consume(cr, uid, [produce_product.id], (subproduct_factor * production_qty), context=context)
|
||||
|
||||
@@ -861,13 +886,19 @@ class mrp_production(osv.osv):
|
||||
"""
|
||||
res = True
|
||||
for production in self.browse(cr, uid, ids):
|
||||
if not production.product_lines:
|
||||
if not self.action_compute(cr, uid, [production.id]):
|
||||
res = False
|
||||
boms = self._action_compute_lines(cr, uid, [production.id])
|
||||
res = False
|
||||
for bom in boms:
|
||||
product = self.pool.get('product.product').browse(cr, uid, bom['product_id'])
|
||||
if product.type in ('product', 'consu'):
|
||||
res = True
|
||||
return res
|
||||
|
||||
def _get_auto_picking(self, cr, uid, production):
|
||||
return True
|
||||
|
||||
def _hook_create_post_procurement(self, cr, uid, production, procurement_id, context=None):
|
||||
return True
|
||||
|
||||
def _make_production_line_procurement(self, cr, uid, production_line, shipment_move_id, context=None):
|
||||
procurement_order = self.pool.get('procurement.order')
|
||||
@@ -1015,11 +1046,13 @@ class mrp_production(osv.osv):
|
||||
|
||||
for line in production.product_lines:
|
||||
consume_move_id = self._make_production_consume_line(cr, uid, line, produce_move_id, source_location_id=source_location_id, context=context)
|
||||
shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\
|
||||
if shipment_id:
|
||||
shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\
|
||||
destination_location_id=source_location_id, context=context)
|
||||
self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
|
||||
self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
|
||||
|
||||
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [shipment_id])
|
||||
if shipment_id:
|
||||
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [shipment_id])
|
||||
production.write({'state':'confirmed'}, context=context)
|
||||
return shipment_id
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
-
|
||||
I create Bill of Materials with one service type product and one consumable product.
|
||||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_test1}:
|
||||
company_id: base.main_company
|
||||
name: PC Assemble SC234
|
||||
product_id: product.product_product_3
|
||||
product_qty: 1.0
|
||||
type: normal
|
||||
bom_lines:
|
||||
- company_id: base.main_company
|
||||
name: On Site Assistance
|
||||
product_id: product.product_product_2
|
||||
product_qty: 1.0
|
||||
- company_id: base.main_company
|
||||
name: GrapWorks Software
|
||||
product_id: product.product_product_44
|
||||
product_qty: 1.0
|
||||
-
|
||||
I make the production order using BoM having one service type product and one consumable product.
|
||||
-
|
||||
!record {model: mrp.production, id: mrp_production_servicetype_mo1}:
|
||||
product_id: product.product_product_5
|
||||
product_qty: 1.0
|
||||
bom_id: mrp_bom_test1
|
||||
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
-
|
||||
I compute the data of production order.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
self.action_compute(cr, uid, [ref("mrp_production_servicetype_mo1")], {"lang": "en_US", "tz": False, "search_default_Current": 1,
|
||||
"active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
|
||||
"active_id": ref("mrp.menu_mrp_production_action"), })
|
||||
-
|
||||
I confirm the production order.
|
||||
-
|
||||
!workflow {model: mrp.production, action: button_confirm, ref: mrp_production_servicetype_mo1}
|
||||
-
|
||||
I confirm the Consume Products.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_servicetype_mo1"))
|
||||
assert order.state == 'confirmed', "Production order should be confirmed."
|
||||
for move_line in order.move_lines:
|
||||
move_line.action_consume(move_line.product_qty)
|
||||
-
|
||||
I processed the Product Entirely.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_servicetype_mo1"))
|
||||
assert order.state == 'in_production', 'Production order should be in production State.'
|
||||
for move_created in order.move_created_ids:
|
||||
move_created.action_done()
|
||||
-
|
||||
I produce product.
|
||||
-
|
||||
!python {model: mrp.product.produce}: |
|
||||
context.update({'active_id': ref('mrp_production_servicetype_mo1')})
|
||||
-
|
||||
!record {model: mrp.product.produce, id: mrp_product_produce_1}:
|
||||
mode: 'consume_produce'
|
||||
-
|
||||
!python {model: mrp.product.produce}: |
|
||||
self.do_produce(cr, uid, [ref('mrp_product_produce_1')], context=context)
|
||||
-
|
||||
I check production order after produced.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_servicetype_mo1"))
|
||||
assert order.state == 'done', "Production order should be closed."
|
||||
-
|
||||
I create Bill of Materials with two service type products.
|
||||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_test_2}:
|
||||
company_id: base.main_company
|
||||
name: PC Assemble SC234
|
||||
product_id: product.product_product_3
|
||||
product_qty: 1.0
|
||||
type: normal
|
||||
bom_lines:
|
||||
- company_id: base.main_company
|
||||
name: On Site Monitoring
|
||||
product_id: product.product_product_1
|
||||
product_qty: 1.0
|
||||
- company_id: base.main_company
|
||||
name: On Site Assistance
|
||||
product_id: product.product_product_2
|
||||
product_qty: 1.0
|
||||
-
|
||||
I make the production order using BoM having two service type products.
|
||||
-
|
||||
!record {model: mrp.production, id: mrp_production_servicetype_2}:
|
||||
product_id: product.product_product_5
|
||||
product_qty: 1.0
|
||||
bom_id: mrp_bom_test_2
|
||||
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
-
|
||||
I compute the data of production order.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
self.action_compute(cr, uid, [ref("mrp_production_servicetype_2")], {"lang": "en_US", "tz": False, "search_default_Current": 1,
|
||||
"active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
|
||||
"active_id": ref("mrp.menu_mrp_production_action"), })
|
||||
-
|
||||
I confirm the production order.
|
||||
-
|
||||
!workflow {model: mrp.production, action: button_confirm, ref: mrp_production_servicetype_2}
|
||||
-
|
||||
Now I start production.
|
||||
-
|
||||
!workflow {model: mrp.production, action: button_produce, ref: mrp_production_servicetype_2}
|
||||
-
|
||||
I check that production order in production state after start production.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_servicetype_2"))
|
||||
assert order.state == 'in_production', 'Production order should be in production State.'
|
||||
-
|
||||
I produce product.
|
||||
-
|
||||
!python {model: mrp.product.produce}: |
|
||||
context.update({'active_id': ref('mrp_production_servicetype_2')})
|
||||
-
|
||||
!record {model: mrp.product.produce, id: mrp_product_produce_2}:
|
||||
mode: 'consume_produce'
|
||||
-
|
||||
!python {model: mrp.product.produce}: |
|
||||
self.do_produce(cr, uid, [ref('mrp_product_produce_2')], context=context)
|
||||
-
|
||||
I check production order after produced.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_servicetype_2"))
|
||||
assert order.state == 'done', "Production order should be closed."
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'MRP Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_mrp_manager}:
|
||||
!record {model: res.users, id: res_users_mrp_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: MRP Manager
|
||||
login: mam
|
||||
@@ -17,7 +17,7 @@
|
||||
-
|
||||
Create a user as 'MRP User'
|
||||
-
|
||||
!record {model: res.users, id: res_users_mrp_user}:
|
||||
!record {model: res.users, id: res_users_mrp_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: MRP User
|
||||
login: mau
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='workcenter_lines']/form//field[@name='name']" position="before">
|
||||
<header colspan="8">
|
||||
<button name="button_start_working" string="Start" states="draft" icon="terp-gtk-jump-to-ltr" help="Start Working"/>
|
||||
<button name="button_start_working" string="Start" states="draft" icon="gtk-media-play" help="Start Working"/>
|
||||
<button name="button_cancel" string="Cancel Order" states="draft,startworking" icon="gtk-stop" help="Cancel Order"/>
|
||||
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert" help="Set to Draft"/>
|
||||
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause" help="Resume Work Order"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<xpath expr="//field[@name='workcenter_lines']/tree/field[@name='hour']" position="after">
|
||||
<field name="state"/>
|
||||
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert"/>
|
||||
<button name="button_start_working" string="Start" states="draft" icon="terp-gtk-jump-to-ltr"/>
|
||||
<button name="button_start_working" string="Start" states="draft" icon="gtk-media-play"/>
|
||||
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause"/>
|
||||
<button name="button_pause" string="Pending" states="startworking" icon="gtk-media-pause"/>
|
||||
<button name="button_done" string="Finished" states="startworking" icon="terp-check"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'MRP User'
|
||||
-
|
||||
!record {model: res.users, id: res_mrp_operation_user}:
|
||||
!record {model: res.users, id: res_mrp_operation_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: MRP User
|
||||
login: maou
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'MRP Repair Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_mrp_repair_manager}:
|
||||
!record {model: res.users, id: res_mrp_repair_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: MRP Manager
|
||||
login: marm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'MRP Repair User'
|
||||
-
|
||||
!record {model: res.users, id: res_mrp_repair_user}:
|
||||
!record {model: res.users, id: res_mrp_repair_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: MRP User
|
||||
login: maru
|
||||
|
||||
@@ -377,20 +377,6 @@ namespace OpenERPClient
|
||||
return version;
|
||||
}
|
||||
|
||||
public bool check_connectivity()
|
||||
{
|
||||
/*
|
||||
It will check connection on given server url.
|
||||
|
||||
:return : True or False.
|
||||
*/
|
||||
|
||||
this.Open(OpenERPClient.OpenERPService.Common);
|
||||
bool flag = this.rpcclient.check_connectivity();
|
||||
this.Close();
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,6 @@ namespace OpenERPClient
|
||||
[XmlRpcMethod("server_version")]
|
||||
string ServerVersion();
|
||||
|
||||
[XmlRpcMethod("check_connectivity")]
|
||||
bool check_connectivity();
|
||||
|
||||
|
||||
}
|
||||
public interface Ixmlrpcconnect : IOpenERPCommon, IOpenERPDB, IOpenERPObject
|
||||
{
|
||||
@@ -84,11 +80,6 @@ namespace OpenERPClient
|
||||
{
|
||||
return rpcclient.ServerVersion();
|
||||
}
|
||||
|
||||
public bool check_connectivity()
|
||||
{
|
||||
return rpcclient.check_connectivity();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
+1
@@ -64,6 +64,7 @@
|
||||
this.chkSSL.TabIndex = 19;
|
||||
this.chkSSL.Text = "SSL (https)";
|
||||
this.chkSSL.UseVisualStyleBackColor = true;
|
||||
this.chkSSL.CheckedChanged += new System.EventHandler(this.chkSSL_CheckedChanged);
|
||||
//
|
||||
// txt_server_port
|
||||
//
|
||||
|
||||
+31
-2
@@ -20,6 +20,13 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using OpenERPClient;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Security;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Net.Security;
|
||||
|
||||
namespace OpenERPOutlookPlugin
|
||||
{
|
||||
@@ -50,6 +57,15 @@ namespace OpenERPOutlookPlugin
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ValidateServerCertificate(
|
||||
object sender,
|
||||
X509Certificate certificate,
|
||||
X509Chain chain,
|
||||
SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
// Somehow the cert always has PolicyErrors so I am returning true regardless.
|
||||
return true;
|
||||
}
|
||||
|
||||
private void btn_server_ok_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -59,7 +75,10 @@ namespace OpenERPOutlookPlugin
|
||||
OpenERPConnect openerp_connect = openerp_outlook.Connection;
|
||||
string url = Tools.JoinURL(this.txt_server_host.Text, this.txt_server_port.Text, this.chkSSL.Checked);
|
||||
this.txtServerURL.Text = url;
|
||||
openerp_connect.check_connectivity();
|
||||
if (this.chkSSL.Checked)
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateServerCertificate);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -74,6 +93,16 @@ namespace OpenERPOutlookPlugin
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
private void chkSSL_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.chkSSL.Checked)
|
||||
{
|
||||
txt_server_port.Text = "443";
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_server_port.Text = "8069";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -162,7 +162,7 @@ class pos_details(report_sxw.rml_parse):
|
||||
for tax in line_taxes['taxes']:
|
||||
taxes.setdefault(tax['id'], {'name': tax['name'], 'amount':0.0})
|
||||
taxes[tax['id']]['amount'] += tax['amount']
|
||||
return [value for value in taxes.values()] or False
|
||||
return taxes.values()
|
||||
|
||||
def _get_user_names(self, user_ids):
|
||||
user_obj = self.pool.get('res.users')
|
||||
|
||||
@@ -31,3 +31,9 @@ class portal(osv.osv):
|
||||
'is_portal': fields.boolean('Portal', help="If checked, this group is usable as a portal."),
|
||||
}
|
||||
|
||||
class res_users(osv.Model):
|
||||
_inherit = 'res.users'
|
||||
def _signup_create_user(self, cr, uid, values, context=None):
|
||||
values['share'] = True
|
||||
return super(res_users, self)._signup_create_user(cr, uid, values, context=context)
|
||||
|
||||
|
||||
@@ -93,4 +93,10 @@
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<data>
|
||||
<record id="auth_signup.default_template_user" model="res.users">
|
||||
<field name="share" eval="True"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
Mr Demo Portal</field>
|
||||
<!-- Avoid auto-including this user in any default group -->
|
||||
<field name="groups_id" eval="[(5,)]"/>
|
||||
<field name="share" eval="True" />
|
||||
</record>
|
||||
|
||||
<!-- Add the demo user to the portal (and therefore to the portal member group) -->
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="contact_form_view"/>
|
||||
<field name="target">inline</field>
|
||||
<field name="context">{'default_type': 'lead'}</field>
|
||||
</record>
|
||||
|
||||
<!-- attach it to the portal menu -->
|
||||
|
||||
@@ -104,6 +104,14 @@ class account_invoice(osv.Model):
|
||||
pass
|
||||
return action_dict
|
||||
|
||||
def invoice_validate(self, cr, uid, ids, context=None):
|
||||
# fetch the partner's id and subscribe the partner to the invoice
|
||||
for invoice in self.browse(cr, uid, ids, context=context):
|
||||
partner = invoice.partner_id
|
||||
if partner.id not in invoice.message_follower_ids:
|
||||
self.message_subscribe(cr, uid, [invoice.id], [partner.id], context=context)
|
||||
return super(account_invoice, self).invoice_validate(cr, uid, ids, context=context)
|
||||
|
||||
def get_signup_url(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1
|
||||
document = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
@@ -171,9 +171,7 @@ class product_pricelist(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
date = time.strftime('%Y-%m-%d')
|
||||
if 'date' in context:
|
||||
date = context['date']
|
||||
date = context.get('date') or time.strftime('%Y-%m-%d')
|
||||
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
product_obj = self.pool.get('product.product')
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
<notebook>
|
||||
<page string="Team" name="team">
|
||||
<field colspan="4" name="members" widget="many2many_kanban" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'group_project_user']}">
|
||||
<kanban quick_create="false" create="true">
|
||||
<kanban quick_create="false" create="true" delete="true">
|
||||
<field name="name"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Project manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_project_issue_manager}:
|
||||
!record {model: res.users, id: res_users_project_issue_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Project Manager
|
||||
login: prim
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Project user'
|
||||
-
|
||||
!record {model: res.users, id: res_users_project_issue_user}:
|
||||
!record {model: res.users, id: res_users_project_issue_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Project User
|
||||
login: priu
|
||||
|
||||
@@ -46,12 +46,29 @@
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<!-- This "foreign" process node is duplicated here from the corresponding sale_stock node because
|
||||
`project_mrp` implements a basic procurement system for services without actually using the
|
||||
full-fledged procurement process from sale_stock, and without the dependency. So it stil
|
||||
represents a "procurement system".
|
||||
TODO: To cleanup this invalid foreign external ID, the node should probably be moved to the
|
||||
`sale` module directly, and removed from both `sale_stock` and `project_mrp`.
|
||||
-->
|
||||
<record id="sale_stock.process_node_saleprocurement0" model="process.node">
|
||||
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
|
||||
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||
<field name="kind">subflow</field>
|
||||
<field name="name">Procurement</field>
|
||||
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
|
||||
<field name="process_id" ref="sale.process_process_salesprocess0"/>
|
||||
<field name="model_states">object.state=='confirmed'</field>
|
||||
<field name="flow_start" eval="1"/>
|
||||
</record>
|
||||
<record id="process_transition_procuretask0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Procurement Task"""" name="name"/>
|
||||
<field eval=""""if product type is 'service' then it creates the task."""" name="note"/>
|
||||
<field name="target_node_id" ref="process_node_procuretasktask0"/>
|
||||
<field name="source_node_id" ref="mrp.process_node_productionorder0"/>
|
||||
<field name="source_node_id" ref="sale_stock.process_node_saleprocurement0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_createtask0" model="process.transition">
|
||||
|
||||
@@ -125,4 +125,3 @@ class sale_order(osv.osv):
|
||||
'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'),
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user 'HR Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_hrmanager0}:
|
||||
!record {model: res.users, id: res_users_hrmanager0, view: False}:
|
||||
company_id: base.main_company
|
||||
name: HR Manager
|
||||
login: hr
|
||||
|
||||
@@ -1238,8 +1238,8 @@ class account_invoice(osv.Model):
|
||||
res = super(account_invoice, self).invoice_validate(cr, uid, ids, context=context)
|
||||
purchase_order_obj = self.pool.get('purchase.order')
|
||||
po_ids = purchase_order_obj.search(cr, uid, [('invoice_ids', 'in', ids)], context=context)
|
||||
if po_ids:
|
||||
purchase_order_obj.message_post(cr, uid, po_ids, body=_("Invoice received"), context=context)
|
||||
for po_id in po_ids:
|
||||
purchase_order_obj.message_post(cr, uid, po_id, body=_("Invoice received"), context=context)
|
||||
return res
|
||||
|
||||
def confirm_paid(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Purchase manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_purchase_manager}:
|
||||
!record {model: res.users, id: res_users_purchase_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Purchase Manager
|
||||
login: pm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Purchase user'
|
||||
-
|
||||
!record {model: res.users, id: res_users_purchase_user}:
|
||||
!record {model: res.users, id: res_users_purchase_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Purchase User
|
||||
login: pu
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Purchase Requisition Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_purchase_requisition_manager}:
|
||||
!record {model: res.users, id: res_users_purchase_requisition_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Purchase requisition Manager
|
||||
login: prm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Purchase Requisition User'
|
||||
-
|
||||
!record {model: res.users, id: res_users_purchase_requisition_user}:
|
||||
!record {model: res.users, id: res_users_purchase_requisition_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Purchase requisition User
|
||||
login: pru
|
||||
|
||||
@@ -335,7 +335,7 @@ class WebKitParser(report_sxw):
|
||||
try :
|
||||
html = body_mako_tpl.render(dict(self.parser_instance.localcontext))
|
||||
htmls.append(html)
|
||||
except Exception:
|
||||
except Exception, e:
|
||||
msg = u"%s" % e
|
||||
_logger.error(msg)
|
||||
raise except_osv(_('Webkit render!'), msg)
|
||||
|
||||
@@ -43,6 +43,7 @@ class sale_order(osv.osv):
|
||||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'date_order': fields.date.context_today(self, cr, uid, context=context),
|
||||
'state': 'draft',
|
||||
'invoice_ids': [],
|
||||
'date_confirm': False,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Salesmanager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_salesmanager}:
|
||||
!record {model: res.users, id: res_users_salesmanager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Sales manager
|
||||
login: sm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Salesman'
|
||||
-
|
||||
!record {model: res.users, id: res_users_salesman}:
|
||||
!record {model: res.users, id: res_users_salesman, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Salesman
|
||||
login: su
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import calendar
|
||||
from datetime import date
|
||||
from dateutil import relativedelta
|
||||
|
||||
@@ -31,7 +32,7 @@ class sale_order(osv.osv):
|
||||
_columns = {
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
'categ_ids': fields.many2many('crm.case.categ', 'sale_order_category_rel', 'order_id', 'category_id', 'Categories', \
|
||||
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
|
||||
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]", context="{'object_name': 'crm.lead'}")
|
||||
}
|
||||
|
||||
def _prepare_invoice(self, cr, uid, order, lines, context=None):
|
||||
@@ -48,12 +49,13 @@ class crm_case_section(osv.osv):
|
||||
obj = self.pool.get('sale.order')
|
||||
res = dict.fromkeys(ids, False)
|
||||
month_begin = date.today().replace(day=1)
|
||||
groupby_begin = (month_begin + relativedelta.relativedelta(months=-4)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
date_begin = (month_begin - relativedelta.relativedelta(months=self._period_number - 1)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
date_end = month_begin.replace(day=calendar.monthrange(month_begin.year, month_begin.month)[1]).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
for id in ids:
|
||||
res[id] = dict()
|
||||
created_domain = [('section_id', '=', id), ('state', 'in', ['draft', 'sent']), ('date_order', '>=', groupby_begin)]
|
||||
created_domain = [('section_id', '=', id), ('state', 'in', ['draft', 'sent']), ('date_order', '>=', date_begin), ('date_order', '<=', date_end)]
|
||||
res[id]['monthly_quoted'] = self.__get_bar_values(cr, uid, obj, created_domain, ['amount_total', 'date_order'], 'amount_total', 'date_order', context=context)
|
||||
validated_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'sent']), ('date_confirm', '>=', groupby_begin)]
|
||||
validated_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'sent']), ('date_confirm', '>=', date_begin), ('date_order', '<=', date_end)]
|
||||
res[id]['monthly_confirmed'] = self.__get_bar_values(cr, uid, obj, validated_domain, ['amount_total', 'date_confirm'], 'amount_total', 'date_confirm', context=context)
|
||||
return res
|
||||
|
||||
@@ -61,9 +63,10 @@ class crm_case_section(osv.osv):
|
||||
obj = self.pool.get('account.invoice.report')
|
||||
res = dict.fromkeys(ids, False)
|
||||
month_begin = date.today().replace(day=1)
|
||||
groupby_begin = (month_begin + relativedelta.relativedelta(months=-4)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
date_begin = (month_begin - relativedelta.relativedelta(months=self._period_number - 1)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
date_end = month_begin.replace(day=calendar.monthrange(month_begin.year, month_begin.month)[1]).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
for id in ids:
|
||||
created_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'cancel']), ('date', '>=', groupby_begin)]
|
||||
created_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'cancel']), ('date', '>=', date_begin), ('date', '<=', date_end)]
|
||||
res[id] = self.__get_bar_values(cr, uid, obj, created_domain, ['price_total', 'date'], 'price_total', 'date', context=context)
|
||||
return res
|
||||
|
||||
|
||||
@@ -249,8 +249,8 @@
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[@class='oe_salesteams_opportunities']" position="after">
|
||||
<div class="oe_salesteams_invoices">
|
||||
<a name="%(action_invoice_salesteams)d" type="action" groups="account.group_account_invoice">Invoices</a>
|
||||
<div class="oe_salesteams_invoices" groups="account.group_account_invoice">
|
||||
<a name="%(action_invoice_salesteams)d" type="action">Invoices</a>
|
||||
<a name="%(account.action_account_invoice_report_all)d" type="action" class="oe_sparkline_bar_link">
|
||||
<field name="monthly_invoiced" widget="sparkline_bar">
|
||||
Revenue of sent invoices per month.<br/>Click to see a detailed analysis of invoices.
|
||||
|
||||
@@ -69,6 +69,19 @@ class mrp_production(osv.osv):
|
||||
res[production.id] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False
|
||||
return res
|
||||
|
||||
def _hook_create_post_procurement(self, cr, uid, production, procurement_id, context=None):
|
||||
def get_parent_move(move):
|
||||
if move.move_dest_id:
|
||||
return get_parent_move(move.move_dest_id)
|
||||
return move
|
||||
|
||||
res = super(mrp_production, self)._hook_create_post_procurement(cr, uid, production, procurement_id, context)
|
||||
if production.move_prod_id:
|
||||
parent_move_line = get_parent_move(production.move_prod_id)
|
||||
if parent_move_line and parent_move_line.sale_line_id:
|
||||
self.pool.get('procurement.order').write(cr, uid, procurement_id, {'sale_line_id': parent_move_line.sale_line_id.id})
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'sale_name': fields.function(_ref_calc, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sales order.'),
|
||||
'sale_ref': fields.function(_ref_calc, multi='sale_name', type='char', string='Sale Reference', help='Indicate the Customer Reference from sales order.'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Stock Salesmanager'
|
||||
-
|
||||
!record {model: res.users, id: res_sale_stock_salesmanager}:
|
||||
!record {model: res.users, id: res_sale_stock_salesmanager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock Sales manager
|
||||
login: ssm
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Stock Salesman'
|
||||
-
|
||||
!record {model: res.users, id: res_sale_stock_salesman}:
|
||||
!record {model: res.users, id: res_sale_stock_salesman, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock Salesman
|
||||
login: ssu
|
||||
@@ -31,7 +31,7 @@
|
||||
-
|
||||
Create a user as 'Stock User'
|
||||
-
|
||||
!record {model: res.users, id: res_stock_user}:
|
||||
!record {model: res.users, id: res_stock_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock User
|
||||
login: sau
|
||||
@@ -46,7 +46,7 @@
|
||||
-
|
||||
Create a user as 'Stock Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_stock_manager}:
|
||||
!record {model: res.users, id: res_stock_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock Manager
|
||||
login: sam
|
||||
|
||||
@@ -151,9 +151,9 @@ class share_wizard(osv.TransientModel):
|
||||
result = dict.fromkeys(ids, '')
|
||||
for this in self.browse(cr, uid, ids, context=context):
|
||||
if this.result_line_ids:
|
||||
ctx = dict(context, share_url_template_hash_arguments=['action_id'])
|
||||
ctx = dict(context, share_url_template_hash_arguments=['action'])
|
||||
user = this.result_line_ids[0]
|
||||
data = dict(dbname=cr.dbname, login=user.login, password=user.password, action_id=this.action_id.id)
|
||||
data = dict(dbname=cr.dbname, login=user.login, password=user.password, action=this.action_id.id)
|
||||
result[this.id] = this.share_url_template(context=ctx) % data
|
||||
return result
|
||||
|
||||
|
||||
+12
-2
@@ -397,7 +397,16 @@ class stock_location(osv.osv):
|
||||
uom_rounding = self.pool.get('product.product').browse(cr, uid, product_id, context=context).uom_id.rounding
|
||||
if context.get('uom'):
|
||||
uom_rounding = uom_obj.browse(cr, uid, context.get('uom'), context=context).rounding
|
||||
for id in self.search(cr, uid, [('location_id', 'child_of', ids)]):
|
||||
|
||||
locations_ids = self.search(cr, uid, [('location_id', 'child_of', ids)])
|
||||
# Fetch only the locations in which this product has ever been processed (in or out)
|
||||
cr.execute("""SELECT l.id FROM stock_location l WHERE l.id in %s AND
|
||||
EXISTS (SELECT 1 FROM stock_move m WHERE m.product_id = %s
|
||||
AND ((state = 'done' AND m.location_dest_id = l.id)
|
||||
OR (state in ('done','assigned') AND m.location_id = l.id)))
|
||||
""", (tuple(locations_ids), product_id,))
|
||||
|
||||
for id in [i for (i,) in cr.fetchall()]:
|
||||
if lock:
|
||||
try:
|
||||
# Must lock with a separate select query because FOR UPDATE can't be used with
|
||||
@@ -1910,7 +1919,8 @@ class stock_move(osv.osv):
|
||||
"""
|
||||
if not prod_id:
|
||||
return {}
|
||||
lang = False
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid)
|
||||
lang = user and user.lang or False
|
||||
if partner_id:
|
||||
addr_rec = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
if addr_rec:
|
||||
|
||||
@@ -759,7 +759,7 @@
|
||||
<header>
|
||||
<button name="draft_force_assign" states="draft" string="Confirm" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="draft_validate" states="draft" string="Confirm & Transfer" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<!-- <button name="action_assign" states="confirmed" string="Check Availability" type="object"/> -->
|
||||
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
|
||||
<button name="force_assign" states="confirmed" string="Force Availability" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="action_process" states="assigned" string="Confirm & Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
|
||||
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice/Refund" attrs="{'invisible': ['|','|',('state','<>','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" context="{'group_field_invisible': True}" type="action" class="oe_highlight" groups="base.group_user"/>
|
||||
@@ -909,7 +909,6 @@
|
||||
</xpath>
|
||||
<xpath expr="/form/header//button[@name='draft_validate']" position="replace">
|
||||
<button name="draft_validate" states="draft" string="Confirm & Deliver" type="object" class="oe_highlight"/>
|
||||
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/header//button[@name='action_process']" position="replace">
|
||||
<button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
Create a user as 'Stock Manager'
|
||||
-
|
||||
!record {model: res.users, id: res_users_stock_manager}:
|
||||
!record {model: res.users, id: res_users_stock_manager, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock Manager
|
||||
login: sam
|
||||
@@ -16,7 +16,7 @@
|
||||
-
|
||||
Create a user as 'Stock User'
|
||||
-
|
||||
!record {model: res.users, id: res_users_stock_user}:
|
||||
!record {model: res.users, id: res_users_stock_user, view: False}:
|
||||
company_id: base.main_company
|
||||
name: Stock User
|
||||
login: sau
|
||||
|
||||
@@ -27,7 +27,7 @@ class change_standard_price(osv.osv_memory):
|
||||
_name = "stock.change.standard.price"
|
||||
_description = "Change Standard Price"
|
||||
_columns = {
|
||||
'new_price': fields.float('Price', required=True, digits_compute=dp.get_precision('Account'),
|
||||
'new_price': fields.float('Price', required=True, digits_compute=dp.get_precision('Product Price'),
|
||||
help="If cost price is increased, stock variation account will be debited "
|
||||
"and stock output account will be credited with the value = (difference of amount * quantity available).\n"
|
||||
"If cost price is decreased, stock variation account will be creadited and stock input account will be debited."),
|
||||
|
||||
@@ -27,6 +27,7 @@ from openerp import tools
|
||||
from openerp.report import report_sxw
|
||||
from openerp.report.interface import report_rml
|
||||
from openerp.tools import to_xml
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class survey_browse_response(report_rml):
|
||||
def create(self, cr, uid, ids, datas, context):
|
||||
@@ -69,7 +70,7 @@ class survey_browse_response(report_rml):
|
||||
rml +="""
|
||||
<fill color="gray"/>
|
||||
<setFont name="Helvetica" size="10"/>
|
||||
<drawRightString x='"""+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">Page : <pageNumber/> </drawRightString>"""
|
||||
<drawRightString x='"""+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">"""+_('Page : ')+"""<pageNumber/> </drawRightString>"""
|
||||
rml +="""</pageGraphics>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
@@ -209,29 +210,29 @@ class survey_browse_response(report_rml):
|
||||
resp_create = tools.ustr(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S')))
|
||||
rml += """<blockTable colWidths='""" + colwidth + """' style="Table_heading">
|
||||
<tr>
|
||||
<td><para style="terp_default_9_Bold">Print Date : </para></td>
|
||||
<td><para style="terp_default_9_Bold">""" + _('Print Date : ') + """</para></td>
|
||||
<td><para style="terp_default_9">""" + to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True)) + """</para></td>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
<td><para style="terp_default_9_Bold">Answered by : </para></td>
|
||||
<td><para style="terp_default_9_Bold">""" +_('Answered by : ') + """</para></td>
|
||||
<td><para style="terp_default_9">""" + to_xml(response.user_id.login or '') + """</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
<td><para style="terp_default_9_Bold">Answer Date : </para></td>
|
||||
<td><para style="terp_default_9_Bold">""" +_('Answer Date : ') + """</para></td>
|
||||
<td><para style="terp_default_9">""" + to_xml(resp_create) + """</para></td>
|
||||
</tr>
|
||||
</blockTable><para style="P2"></para>"""
|
||||
|
||||
status = "Not Finished"
|
||||
if response.state == "done": status = "Finished"
|
||||
status = _("Not Finished")
|
||||
if response.state == "done": status = _("Finished")
|
||||
colwidth = str(tbl_width - 7) + "cm,"
|
||||
colwidth += "7cm"
|
||||
rml += """<blockTable colWidths='""" + str(colwidth) + """' style="title_tbl">
|
||||
<tr>
|
||||
<td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td>
|
||||
<td><para style="descriptive_text_heading">Status :- """ + to_xml(tools.ustr(status)) + """</para><para style="P2"><font></font></para></td>
|
||||
<td><para style="descriptive_text_heading">"""+_('Status :- ')+ to_xml(tools.ustr(status)) + """</para><para style="P2"><font></font></para></td>
|
||||
</tr>
|
||||
</blockTable>"""
|
||||
|
||||
@@ -242,7 +243,7 @@ class survey_browse_response(report_rml):
|
||||
|
||||
for page in survey.page_ids:
|
||||
rml += """<blockTable colWidths='""" + str(_tbl_widths) + """' style="page_tbl">
|
||||
<tr><td><para style="page">Page :- """ + to_xml(tools.ustr(page.title or '')) + """</para></td></tr>
|
||||
<tr><td><para style="page">"""+_('Page :- ') + to_xml(tools.ustr(page.title or '')) + """</para></td></tr>
|
||||
</blockTable>"""
|
||||
if page.note:
|
||||
rml += """<para style="P2"></para>
|
||||
@@ -302,7 +303,7 @@ class survey_browse_response(report_rml):
|
||||
|
||||
else:
|
||||
rml +="""<blockTable colWidths='""" + str(_tbl_widths) + """' style="simple_table">
|
||||
<tr><td> <para style="response">No Answer</para></td> </tr>
|
||||
<tr><td> <para style="response">"""+ _('No Answer') + """</para></td> </tr>
|
||||
</blockTable>"""
|
||||
|
||||
elif que.type in ['multiple_choice_only_one_ans','multiple_choice_multiple_ans']:
|
||||
|
||||
@@ -173,8 +173,8 @@ class survey_question_wiz(osv.osv_memory):
|
||||
# TODO: l10n, cleanup this code to make it readable. Or template?
|
||||
xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'})
|
||||
record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']])
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"})
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(" Answer :- " + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"})
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_('Answer Of :- ') + record.user_id.name + _(', Date :- ') + record.date_create.split('.')[0] )), 'align':"0.0"})
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_(" Answer :- ") + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"})
|
||||
if context.get('response_no',0) > 0:
|
||||
etree.SubElement(xml_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_forward_previous",'string': tools.ustr("Previous Answer"),'type':"object"})
|
||||
if context.get('response_no',0) + 1 < len(context.get('response_id',0)):
|
||||
@@ -221,7 +221,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
selection.append((tools.ustr(ans.id), ans.answer))
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'})
|
||||
etree.SubElement(xml_group, 'field', {'readonly':str(readonly), 'name': tools.ustr(que.id) + "_selection"})
|
||||
fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':"Answer"}
|
||||
fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':_('Answer')}
|
||||
|
||||
elif que_rec.type == 'multiple_choice_multiple_ans':
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
@@ -374,10 +374,10 @@ class survey_question_wiz(osv.osv_memory):
|
||||
|
||||
if pre_button:
|
||||
etree.SubElement(xml_footer, 'label', {'string': ""})
|
||||
etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':"Previous",'type':"object"})
|
||||
but_string = "Next"
|
||||
etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':_('Previous'),'type':"object"})
|
||||
but_string = _('Next')
|
||||
if int(page_number) + 1 == total_pages:
|
||||
but_string = "Done"
|
||||
but_string = _('Done')
|
||||
if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)):
|
||||
etree.SubElement(xml_footer, 'label', {'string': ""})
|
||||
etree.SubElement(xml_footer, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_highlight"})
|
||||
@@ -390,8 +390,8 @@ class survey_question_wiz(osv.osv_memory):
|
||||
else:
|
||||
etree.SubElement(xml_footer, 'label', {'string': ""})
|
||||
etree.SubElement(xml_footer, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_highlight"})
|
||||
etree.SubElement(xml_footer, 'label', {'string': "or"})
|
||||
etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':"Exit",'class':"oe_link"})
|
||||
etree.SubElement(xml_footer, 'label', {'string': _('or')})
|
||||
etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':_('Exit'),'class':"oe_link"})
|
||||
etree.SubElement(xml_footer, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_survey_title_page oe_right"})
|
||||
|
||||
root = xml_form.getroottree()
|
||||
|
||||
@@ -1,595 +0,0 @@
|
||||
@charset "utf-8";
|
||||
/* ---- CKEditor Minimal Reset ---- */
|
||||
.navbar.navbar-inverse .cke_chrome {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.navbar.navbar-inverse .cke_inner {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.navbar.navbar-inverse .cke_toolbar {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.navbar.navbar-inverse .cke_combo_button {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.navbar.navbar-inverse .cke_button {
|
||||
padding-top: 7px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
.navbar.navbar-inverse .cke_top {
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
}
|
||||
|
||||
/* ---- OpenERP Style ---- */
|
||||
.oe_website_editorbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
z-index: 20000;
|
||||
background: #414141, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #646060), color-stop(100%, #262626));
|
||||
background: #414141, -webkit-linear-gradient(#646060, #262626);
|
||||
background: #414141, -moz-linear-gradient(#646060, #262626);
|
||||
background: #414141, -o-linear-gradient(#646060, #262626);
|
||||
background: #414141, linear-gradient(#646060, #262626);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.oe_website_editorbar li {
|
||||
display: inline;
|
||||
color: #eeeeee;
|
||||
}
|
||||
.oe_website_editorbar li:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
text-shadow: black 0px 0px 3px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.oe_website_editorbar .oe_rte_toolbar div.dropdown {
|
||||
display: inline-block;
|
||||
}
|
||||
.oe_website_editorbar .oe_rte_toolbar div.dropdown li {
|
||||
display: list-item;
|
||||
}
|
||||
.oe_website_editorbar .oe_rte_toolbar button {
|
||||
font-family: FontAwesome;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
.oe_website_editorbar .oe_rte_toolbar button.oe_button_list {
|
||||
padding-right: 3px;
|
||||
}
|
||||
.oe_website_editorbar .oe_rte_toolbar button.oe_button_list:after {
|
||||
content: "\F0D7";
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
.oe_editable:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.css_non_editable_mode_hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.oe_carousel_options {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
z-index: 1;
|
||||
display: none;
|
||||
}
|
||||
.oe_carousel_options > * {
|
||||
display: inline-block !important;
|
||||
vertical-align: middle !important;
|
||||
position: relative !important;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
/* ---- EDITOR BAR ---- */
|
||||
table.editorbar-panel {
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
table.editorbar-panel td {
|
||||
border: 1px solid #aaaaaa;
|
||||
}
|
||||
table.editorbar-panel td.selected {
|
||||
background-color: #b1c9d9;
|
||||
}
|
||||
|
||||
.oe_translate_examples li {
|
||||
margin: 10px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.oe_translatable_text {
|
||||
outline: 1px solid black;
|
||||
}
|
||||
|
||||
.oe_translatable_field {
|
||||
outline: 1px dashed black;
|
||||
}
|
||||
|
||||
.oe_translatable_text.oe_dirty, .oe_translatable_field.oe_dirty {
|
||||
outline-color: red;
|
||||
}
|
||||
|
||||
.oe_translatable_text.oe_dirty:empty {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.oe_translatable_todo {
|
||||
background: #ffffb6;
|
||||
}
|
||||
|
||||
/* ---- RTE ---- */
|
||||
.oe_editable .btn {
|
||||
-webkit-user-select: auto;
|
||||
-moz-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
|
||||
.modal-dialog.select-image {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.modal .existing-attachments .pager {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modal .image-preview {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.cke_widget_drag_handler_container {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* ---- SNIPPET EDITOR ---- */
|
||||
#oe_snippets {
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 50px;
|
||||
background: #282828;
|
||||
box-shadow: 0px 10px 10px -10px black inset;
|
||||
z-index: 1010;
|
||||
overflow: hidden;
|
||||
}
|
||||
#oe_snippets:hover {
|
||||
height: auto;
|
||||
}
|
||||
#oe_snippets .scroll {
|
||||
white-space: nowrap;
|
||||
overflow-y: auto;
|
||||
}
|
||||
#oe_snippets .nav {
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
}
|
||||
#oe_snippets .nav > li {
|
||||
display: inline-block;
|
||||
float: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
#oe_snippets .nav > li > a {
|
||||
padding: 2px 10px !important;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
#oe_snippets .pill-content {
|
||||
margin-top: 24px;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#oe_snippets .pill-content > div {
|
||||
display: inline-block;
|
||||
background: black;
|
||||
padding: 5px;
|
||||
}
|
||||
#oe_snippets .pill-content > div label {
|
||||
width: 44px;
|
||||
height: 100%;
|
||||
color: white;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#oe_snippets .pill-content > div label div {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
-webkit-transform: translate(-39px, 44px);
|
||||
-moz-transform: translate(-39px, 44px);
|
||||
-ms-transform: translate(-39px, 44px);
|
||||
-o-transform: translate(-39px, 44px);
|
||||
transform: translate(-39px, 44px);
|
||||
-webkit-transform-origin: 50% 50% 50%;
|
||||
-moz-transform-origin: 50% 50% 50%;
|
||||
-ms-transform-origin: 50% 50% 50%;
|
||||
-o-transform-origin: 50% 50% 50%;
|
||||
transform-origin: 50% 50% 50%;
|
||||
}
|
||||
|
||||
.oe_snippet {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 1px;
|
||||
margin-top: 0px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: move;
|
||||
pointer-events: none;
|
||||
}
|
||||
.oe_snippet .oe_snippet_thumbnail {
|
||||
pointer-events: auto;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
color: white;
|
||||
position: relative;
|
||||
}
|
||||
.oe_snippet .oe_snippet_thumbnail .oe_snippet_thumbnail_title {
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
}
|
||||
.oe_snippet .oe_snippet_thumbnail .oe_snippet_thumbnail_img {
|
||||
box-shadow: inset 0px 0px 0px 3px #333333;
|
||||
}
|
||||
.oe_snippet .oe_snippet_thumbnail span, .oe_snippet .oe_snippet_thumbnail div {
|
||||
line-height: 18px;
|
||||
}
|
||||
.oe_snippet > :not(.oe_snippet_thumbnail) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#oe_snippets .oe_snippet_thumbnail {
|
||||
background: #747474, -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, rgba(0, 0, 0, 0.25)), color-stop(100%, rgba(0, 0, 0, 0.4)));
|
||||
background: #747474, -webkit-radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
|
||||
background: #747474, -moz-radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
|
||||
background: #747474, -o-radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
|
||||
background: #747474, radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
|
||||
}
|
||||
|
||||
/* ---- SNIPPETS DROP ZONES ---- */
|
||||
.oe_drop_zone.oe_insert {
|
||||
display: block;
|
||||
height: 48px;
|
||||
margin: 0px;
|
||||
margin-top: -4px;
|
||||
margin-bottom: -44px;
|
||||
-webkit-transition: margin 250ms linear;
|
||||
-moz-transition: margin 250ms linear;
|
||||
-o-transition: margin 250ms linear;
|
||||
transition: margin 250ms linear;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
}
|
||||
.oe_drop_zone.oe_insert:not(.oe_vertical):before {
|
||||
content: "";
|
||||
display: block;
|
||||
border-top: dashed 2px rgba(209, 178, 255, 0.72);
|
||||
position: relative;
|
||||
top: 0px;
|
||||
}
|
||||
.oe_drop_zone.oe_insert.oe_hover:before {
|
||||
border-top: dashed 2px rgba(116, 255, 161, 0.72);
|
||||
}
|
||||
.oe_drop_zone.oe_insert.oe_vertical {
|
||||
width: 48px;
|
||||
float: left;
|
||||
position: relative;
|
||||
margin: 0px -24px !important;
|
||||
}
|
||||
.oe_drop_zone.oe_insert.oe_overlay {
|
||||
background: rgba(153, 0, 255, 0.17);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.oe_drop_zone, .oe_drop_zone_style {
|
||||
background: rgba(153, 0, 255, 0.17);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.oe_drop_zone.oe_hover, .oe_drop_zone_style.oe_hover {
|
||||
background: rgba(0, 255, 133, 0.22);
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.oe_drop_zone_style {
|
||||
color: white;
|
||||
height: 48px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
/* ---- SNIPPET MANIPULATOR ---- */
|
||||
.oe_overlay {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background: transparent;
|
||||
border-radius: 3px;
|
||||
-webkit-transition: opacity 100ms linear;
|
||||
-moz-transition: opacity 100ms linear;
|
||||
-o-transition: opacity 100ms linear;
|
||||
transition: opacity 100ms linear;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
}
|
||||
.oe_overlay.oe_active {
|
||||
display: block;
|
||||
border-style: dashed;
|
||||
border-width: 1px;
|
||||
box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0px 0px 0px 1px rgba(255, 255, 255, 0.3) inset;
|
||||
border-color: rgba(153, 0, 255, 0.5);
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle {
|
||||
display: block !important;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle:before {
|
||||
position: relative;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
display: block;
|
||||
background: white;
|
||||
border: solid 1px #9900ff;
|
||||
border-radius: 8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: -8px;
|
||||
padding-left: 1px;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
color: #9900ff;
|
||||
-webkit-transition: background 100ms linear;
|
||||
-moz-transition: background 100ms linear;
|
||||
-o-transition: background 100ms linear;
|
||||
transition: background 100ms linear;
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle:hover:before {
|
||||
background: #9900ff;
|
||||
color: white;
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle.e:before {
|
||||
content: "⇨";
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle.s:before {
|
||||
content: "⇩";
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle.w:before {
|
||||
content: "⇦";
|
||||
}
|
||||
.oe_overlay.oe_active .oe_handle.n:before {
|
||||
content: "⇧";
|
||||
}
|
||||
.oe_overlay .icon.btn {
|
||||
display: inline-block;
|
||||
}
|
||||
.oe_overlay .oe_overlay_options {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: -11px;
|
||||
z-index: 1002;
|
||||
}
|
||||
.oe_overlay .oe_overlay_options .btn, .oe_overlay .oe_overlay_options a {
|
||||
pointer-events: auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
.oe_overlay .oe_overlay_options .dropdown {
|
||||
display: inline-block;
|
||||
}
|
||||
.oe_overlay .oe_overlay_options .dropdown-menu {
|
||||
text-align: left;
|
||||
min-width: 180px;
|
||||
}
|
||||
.oe_overlay .oe_overlay_options .dropdown-menu select, .oe_overlay .oe_overlay_options .dropdown-menu input {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.oe_handle {
|
||||
pointer-events: auto;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin: -4px;
|
||||
}
|
||||
|
||||
.oe_handle.n {
|
||||
left: 2px;
|
||||
width: 100%;
|
||||
top: 0px;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.oe_handle.e {
|
||||
left: auto;
|
||||
top: 2px;
|
||||
height: 100%;
|
||||
right: 0px;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.oe_handle.s {
|
||||
top: auto;
|
||||
left: 2px;
|
||||
width: 100%;
|
||||
bottom: 0px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.oe_handle.w {
|
||||
top: 2px;
|
||||
height: 100%;
|
||||
left: 0px;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.s-resize-important, .s-resize-important * {
|
||||
cursor: s-resize !important;
|
||||
}
|
||||
|
||||
.n-resize-important, .n-resize-important * {
|
||||
cursor: n-resize !important;
|
||||
}
|
||||
|
||||
.e-resize-important, .e-resize-important * {
|
||||
cursor: e-resize !important;
|
||||
}
|
||||
|
||||
.w-resize-important, .w-resize-important * {
|
||||
cursor: w-resize !important;
|
||||
}
|
||||
|
||||
.move-important, .move-important * {
|
||||
cursor: move !important;
|
||||
}
|
||||
|
||||
/* ---- MOBILE PREVIEW ---- */
|
||||
.oe_mobile_preview.modal .modal-content {
|
||||
height: 660px;
|
||||
background-color: black;
|
||||
border: 2px solid #1c1f1f;
|
||||
border-radius: 10px;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
max-width: 330px;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-header {
|
||||
background-color: black;
|
||||
border-bottom: 0;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-header .modal-title {
|
||||
color: #1c1f1f;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-header .close {
|
||||
color: lightgrey;
|
||||
opacity: 1;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-header .close:hover {
|
||||
color: #e00101;
|
||||
opacity: 1;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-body {
|
||||
background-color: black;
|
||||
max-height: 600px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-body .oe_mobile_viewport {
|
||||
width: 320px;
|
||||
height: 568px;
|
||||
padding: 5px;
|
||||
border: none;
|
||||
}
|
||||
.oe_mobile_preview.modal .modal-content .modal-footer {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
/* ---- SEO TOOLS ---- */
|
||||
.oe_seo_configuration .modal-dialog {
|
||||
width: 80%;
|
||||
}
|
||||
.oe_seo_configuration .oe_remove {
|
||||
color: #e00101;
|
||||
}
|
||||
.oe_seo_configuration .oe_seo_suggestion {
|
||||
cursor: pointer;
|
||||
}
|
||||
.oe_seo_configuration .oe_seo_keyword {
|
||||
padding: 0.2em 0.4em 0.2em 0.5em;
|
||||
border-radius: 0.4em;
|
||||
}
|
||||
.oe_seo_configuration .keyword-in-title {
|
||||
background-color: #5cb85c;
|
||||
color: white;
|
||||
}
|
||||
.oe_seo_configuration .keyword-in-description {
|
||||
background-color: #428bca;
|
||||
color: white;
|
||||
}
|
||||
.oe_seo_configuration .keyword-in-body {
|
||||
background-color: #5bc0de;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* ---- ACE EDITOR ---- */
|
||||
.oe_ace_view_editor {
|
||||
-webkit-transition: all 0.2s ease-in;
|
||||
-moz-transition: all 0.2s ease-in;
|
||||
-o-transition: all 0.2s ease-in;
|
||||
transition: all 0.2s ease-in;
|
||||
opacity: 0.3;
|
||||
position: fixed;
|
||||
top: 51px;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
height: 100%;
|
||||
}
|
||||
.oe_ace_view_editor .oe_ace_view_editor_title {
|
||||
width: 100%;
|
||||
padding-top: 4px;
|
||||
padding-left: 4px;
|
||||
height: 40px;
|
||||
background: #2f3129;
|
||||
}
|
||||
.oe_ace_view_editor .oe_ace_view_editor_title .oe_view_list {
|
||||
width: 50%;
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;
|
||||
line-height: normal;
|
||||
}
|
||||
.oe_ace_view_editor .oe_ace_view_editor_title .btn {
|
||||
height: 32px;
|
||||
padding: 0 4px 0 4px;
|
||||
font-size: 14px;
|
||||
font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;
|
||||
line-height: normal;
|
||||
}
|
||||
.oe_ace_view_editor .ace_editor {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
right: 0;
|
||||
bottom: 51px;
|
||||
left: 0;
|
||||
width: 720px;
|
||||
}
|
||||
.oe_ace_view_editor:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.oe_ace_view_editor.oe_ace_open {
|
||||
width: 720px;
|
||||
}
|
||||
.oe_ace_view_editor.oe_ace_closed {
|
||||
width: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* ---- EDITOR TOUR ---- */
|
||||
.popover.tour {
|
||||
z-index: 2010;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
.navbar.navbar-inverse .cke_top
|
||||
background: transparent
|
||||
border: none
|
||||
box-shadow: none
|
||||
-webkit-box-shadow: none
|
||||
-moz-box-shadow: none
|
||||
+box-shadow(none)
|
||||
|
||||
/* ---- OpenERP Style ---- */
|
||||
|
||||
@@ -42,13 +40,13 @@
|
||||
margin: 0
|
||||
z-index: 20000
|
||||
@include background(#414141, linear-gradient(#646060, #262626))
|
||||
box-sizing: border-box
|
||||
+box-sizing(border-box)
|
||||
li
|
||||
display: inline
|
||||
color: #eee
|
||||
&:hover
|
||||
background: rgba(0,0,0,0.2)
|
||||
text-shadow: black 0px 0px 3px
|
||||
+text-shadow(black 0px 0px 3px)
|
||||
color: white
|
||||
|
||||
.oe_website_editorbar .oe_rte_toolbar
|
||||
@@ -141,7 +139,7 @@ table.editorbar-panel
|
||||
right: 0px
|
||||
top: 50px
|
||||
background: rgb(40,40,40)
|
||||
box-shadow: 0px 10px 10px -10px black inset
|
||||
+box-shadow(0px 10px 10px -10px black inset)
|
||||
z-index: 1010
|
||||
overflow: hidden
|
||||
&:hover
|
||||
@@ -188,8 +186,7 @@ table.editorbar-panel
|
||||
margin-top: 0px
|
||||
position: relative
|
||||
overflow: hidden
|
||||
-webkit-user-select: none
|
||||
user-select: none
|
||||
+user-select(none)
|
||||
cursor: move
|
||||
pointer-events: none
|
||||
.oe_snippet_thumbnail
|
||||
@@ -203,7 +200,7 @@ table.editorbar-panel
|
||||
font-size: 12px
|
||||
display: block
|
||||
.oe_snippet_thumbnail_img
|
||||
box-shadow: inset 0px 0px 0px 3px #333333
|
||||
+box-shadow(inset 0px 0px 0px 3px #333333)
|
||||
span, div
|
||||
line-height: 18px
|
||||
& > :not(.oe_snippet_thumbnail)
|
||||
@@ -243,7 +240,7 @@ table.editorbar-panel
|
||||
|
||||
.oe_drop_zone, .oe_drop_zone_style
|
||||
background: rgba(153, 0, 255, 0.17)
|
||||
border-radius: 3px
|
||||
+border-radius(3px)
|
||||
&.oe_hover
|
||||
background: rgba(0, 255, 133, 0.22)
|
||||
z-index: 1001
|
||||
@@ -259,15 +256,15 @@ table.editorbar-panel
|
||||
display: none
|
||||
position: absolute
|
||||
background: transparent
|
||||
border-radius: 3px
|
||||
+border-radius(3px)
|
||||
@include transition(opacity 100ms linear)
|
||||
box-sizing: border-box
|
||||
+box-sizing(border-box)
|
||||
pointer-events: none
|
||||
&.oe_active
|
||||
display: block
|
||||
border-style: dashed
|
||||
border-width: 1px
|
||||
box-shadow: 0px 0px 0px 1px rgba(255,255,255,0.3), 0px 0px 0px 1px rgba(255,255,255,0.3) inset
|
||||
+box-shadow(0px 0px 0px 1px rgba(255,255,255,0.3), 0px 0px 0px 1px rgba(255,255,255,0.3) inset)
|
||||
border-color: rgba(153, 0, 255, 0.5)
|
||||
.oe_handle
|
||||
display: block !important
|
||||
@@ -279,7 +276,7 @@ table.editorbar-panel
|
||||
display: block
|
||||
background: rgba(255, 255, 255, 1)
|
||||
border: solid 1px rgba(153, 0, 255, 1)
|
||||
border-radius: 8px
|
||||
+border-radius(8px)
|
||||
width: 16px
|
||||
height: 16px
|
||||
margin: -8px
|
||||
@@ -326,7 +323,7 @@ table.editorbar-panel
|
||||
top: 50%
|
||||
left: 50%
|
||||
display: block
|
||||
box-sizing: border-box
|
||||
+box-sizing(border-box)
|
||||
width: 8px
|
||||
height: 8px
|
||||
margin: -4px
|
||||
@@ -376,7 +373,7 @@ $icon_close: #E00101
|
||||
height: 660px
|
||||
background-color: $mobile_preview_background
|
||||
border: 2px solid $mobile_preview_border
|
||||
border-radius: 10px
|
||||
+border-radius(10px)
|
||||
margin: auto
|
||||
top: 0
|
||||
left: 0
|
||||
@@ -386,16 +383,16 @@ $icon_close: #E00101
|
||||
.modal-header
|
||||
background-color: $mobile_preview_background
|
||||
border-bottom: 0
|
||||
border-top-left-radius: 10px
|
||||
border-top-right-radius: 10px
|
||||
+border-top-left-radius(10px)
|
||||
+border-top-right-radius(10px)
|
||||
.modal-title
|
||||
color: $mobile_preview_border
|
||||
.close
|
||||
color: lightgrey
|
||||
opacity: 1
|
||||
+opacity(1)
|
||||
.close:hover
|
||||
color: $icon_close
|
||||
opacity: 1
|
||||
+opacity(1)
|
||||
.modal-body
|
||||
background-color: $mobile_preview_background
|
||||
max-height: 600px
|
||||
@@ -425,9 +422,9 @@ $highlighted_text_color: #ffffff
|
||||
cursor: pointer
|
||||
.oe_seo_keyword
|
||||
padding: .2em .4em .2em .5em
|
||||
border-radius: .4em
|
||||
+border-radius(.4em)
|
||||
.keyword-in-title
|
||||
background-color: $in_title_color
|
||||
background-color: $in_title_color+pointer
|
||||
color: $highlighted_text_color
|
||||
.keyword-in-description
|
||||
background-color: $in_description_color
|
||||
@@ -442,6 +439,10 @@ $ace_width: 720px
|
||||
$editorbar_height: 40px
|
||||
// TODO Fix => might break with themes
|
||||
$navbar_height: 51px
|
||||
@mixin pointer-events($type: none)
|
||||
$type: unquote($type)
|
||||
@include experimental(pointer-events, $type,-moz, -webkit, not -o, not -ms, -khtml, official)
|
||||
|
||||
|
||||
@mixin editor-font
|
||||
font-size: 14px
|
||||
@@ -449,7 +450,7 @@ $navbar_height: 51px
|
||||
line-height: normal
|
||||
.oe_ace_view_editor
|
||||
@include transition(all 0.2s ease-in)
|
||||
opacity: 0.3
|
||||
+opacity(0.3)
|
||||
position: fixed
|
||||
top: $navbar_height
|
||||
right: 0
|
||||
@@ -477,16 +478,15 @@ $navbar_height: 51px
|
||||
left: 0
|
||||
width: $ace_width
|
||||
&:hover
|
||||
opacity: 1
|
||||
+opacity(1)
|
||||
&.oe_ace_open
|
||||
width: $ace_width
|
||||
&.oe_ace_closed
|
||||
width: 0
|
||||
opacity: 0
|
||||
+opacity(0)
|
||||
|
||||
/* ---- EDITOR TOUR ---- */
|
||||
|
||||
.popover.tour
|
||||
z-index: 2010
|
||||
|
||||
// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:
|
||||
|
||||
Reference in New Issue
Block a user