[MERGE] trunk

bzr revid: fme@openerp.com-20121108111330-pw6cr9l3hwii6jjc
This commit is contained in:
Fabien Meghazi
2012-11-08 12:13:30 +01:00
23 changed files with 104 additions and 47 deletions
+8
View File
@@ -541,10 +541,18 @@ class account_account(osv.osv):
return False
return True
def _check_company_account(self, cr, uid, ids, context=None):
for account in self.browse(cr, uid, ids, context=context):
if account.parent_id:
if account.company_id != account.parent_id.company_id:
return False
return True
_constraints = [
(_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou cannot define children to an account with internal type different of "View".', ['type']),
(_check_account_type, 'Configuration Error!\nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable".', ['user_type','type']),
(_check_company_account, 'Error!\nYou cannot create an account which has parent account of different company.', ['parent_id']),
]
_sql_constraints = [
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
@@ -16,10 +16,10 @@
<group col="4">
<field name="name"/>
<field name="model_id"/>
<field name="model" invisible="1"/>
<field name="filter_id" domain="[('model_id','=',model)]" context="{'default_model_id': model}"/>
<field name="sequence"/>
<field name="active"/>
<field name="model" invisible="1"/>
</group>
<notebook>
<page string="Conditions">
+2 -2
View File
@@ -60,14 +60,14 @@ class sale_config_settings(osv.osv_memory):
'module_web_linkedin': fields.boolean('Get contacts automatically from linkedIn',
help="""When you create a new contact (person or company), you will be able to load all the data from LinkedIn (photos, address, etc)."""),
'module_crm': fields.boolean('CRM'),
'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plugin',
'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plug-in',
help="""The plugin allows you archive email and its attachments to the selected
OpenERP objects. You can select a partner, or a lead and
attach the selected mail as a .eml file in
the attachment of a selected record. You can create documents for CRM Lead,
Partner from the selected emails.
This installs the module plugin_thunderbird."""),
'module_plugin_outlook': fields.boolean('Enable Outlook plugin',
'module_plugin_outlook': fields.boolean('Enable Outlook plug-in',
help="""The Outlook plugin allows you to select an object that you would like to add
to your email and its attachments from MS Outlook. You can select a partner,
or a lead object and archive a selected
+6 -3
View File
@@ -56,6 +56,7 @@ added to partners that match the segmentation criterions after computation.'),
@param uid: the current user’s ID for security checks,
@param ids: List of Process continue’s IDs"""
partner_obj = self.pool.get('res.partner')
categs = self.read(cr, uid, ids, ['categ_id', 'exclusif', 'partner_id',\
'sales_purchase_active', 'profiling_active'])
for categ in categs:
@@ -80,9 +81,11 @@ added to partners that match the segmentation criterions after computation.'),
for pid in to_remove_list:
partners.remove(pid)
for partner_id in partners:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) \
values (%s,%s)', (categ['categ_id'][0], partner_id))
for partner in partner_obj.browse(cr, uid, partners):
category_ids = [categ_id.id for categ_id in partner.category_id]
if categ['categ_id'][0] not in category_ids:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) \
values (%s,%s)', (categ['categ_id'][0], partner.id))
self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
return True
+5 -2
View File
@@ -244,6 +244,7 @@ class crm_segmentation(osv.osv):
@param uid: the current user’s ID for security checks,
@param ids: List of crm segmentation’s IDs """
partner_obj = self.pool.get('res.partner')
categs = self.read(cr,uid,ids,['categ_id','exclusif','partner_id', \
'sales_purchase_active', 'profiling_active'])
for categ in categs:
@@ -280,8 +281,10 @@ class crm_segmentation(osv.osv):
for pid in to_remove_list:
partners.remove(pid)
for partner_id in partners:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner_id))
for partner in partner_obj.browse(cr, uid, partners):
category_ids = [categ_id.id for categ_id in partner.category_id]
if categ['categ_id'][0] not in category_ids:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner.id))
self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
return True
+2 -1
View File
@@ -510,7 +510,7 @@
<field name="model">event.registration</field>
<field name="arch" type="xml">
<search string="Event Registration">
<field name="name" string="Participant" filter_domain="['|','|','|',('name','ilike',self),('partner_id','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
<field name="name" string="Participant" filter_domain="['|','|',('name','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
@@ -519,6 +519,7 @@
<filter icon="terp-personal" string="My Registrations" help="My Registrations" domain="[('user_id','=',uid)]"/>
<field name="event_id"/>
<field name="user_id"/>
<field name="partner_id"/>
<group expand="0" string="Group By...">
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
+1
View File
@@ -291,6 +291,7 @@ survey_request()
class hr_evaluation_interview(osv.osv):
_name = 'hr.evaluation.interview'
_inherits = {'survey.request': 'request_id'}
_inherit = 'mail.thread'
_rec_name = 'request_id'
_description = 'Appraisal Interview'
_columns = {
+18
View File
@@ -113,6 +113,13 @@ class hr_holidays(osv.osv):
result[hol.id] = hol.number_of_days_temp
return result
def _check_date(self, cr, uid, ids):
for holiday in self.browse(cr, uid, ids):
holiday_ids = self.search(cr, uid, [('date_from', '<=', holiday.date_to), ('date_to', '>=', holiday.date_from), ('employee_id', '=', holiday.employee_id.id), ('id', '<>', holiday.id)])
if holiday_ids:
return False
return True
_columns = {
'name': fields.char('Description', size=64),
'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved')],
@@ -146,6 +153,10 @@ class hr_holidays(osv.osv):
'user_id': lambda obj, cr, uid, context: uid,
'holiday_type': 'employee'
}
_constraints = [
(_check_date, 'You can not have 2 leaves that overlaps on same day!', ['date_from','date_to']),
]
_sql_constraints = [
('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "The employee or employee category of this request is missing."),
('date_check2', "CHECK ( (type='add') OR (date_from <= date_to))", "The start date must be anterior to the end date."),
@@ -252,6 +263,13 @@ class hr_holidays(osv.osv):
result['value']['number_of_days_temp'] = 0
return result
def write(self, cr, uid, ids, vals, context=None):
check_fnct = self.pool.get('hr.holidays.status').check_access_rights
for holiday in self.browse(cr, uid, ids, context=context):
if holiday.state in ('validate','validate1') and not check_fnct(cr, uid, 'write', raise_exception=False):
raise osv.except_osv(_('Warning!'),_('You cannot modify a leave request that has been approved. Contact a human resource manager.'))
return super(hr_holidays, self).write(cr, uid, ids, vals, context=context)
def set_to_draft(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {
+4 -4
View File
@@ -34,8 +34,8 @@
<record model="hr.holidays" id="hr_holidays_employee1_vc">
<field name="name">Summer Vacation</field>
<field name="holiday_status_id" ref="holiday_status_unpaid"/>
<field eval="time.strftime('%Y-%m-20')" name="date_from"/>
<field eval="time.strftime('%Y-%m-22')" name="date_to"/>
<field eval="time.strftime('%Y-%m-23')" name="date_from"/>
<field eval="time.strftime('%Y-%m-25')" name="date_to"/>
<field name="type">add</field>
<field name="state">draft</field>
<field name="number_of_days_temp">7</field>
@@ -45,8 +45,8 @@
<record model="hr.holidays" id="hr_holidays_employee1_int_tour">
<field name="name">International Tour</field>
<field name="holiday_status_id" ref="holiday_status_comp"/>
<field eval="time.strftime('%Y-%m-20')" name="date_from"/>
<field eval="time.strftime('%Y-%m-22')" name="date_to"/>
<field eval="time.strftime('%Y-%m-26')" name="date_from"/>
<field eval="time.strftime('%Y-%m-28')" name="date_to"/>
<field name="type">add</field>
<field name="number_of_days_temp">7</field>
<field name="employee_id" ref="hr.employee_fp"/>
+1 -1
View File
@@ -22,12 +22,12 @@
import mail_message_subtype
import mail_alias
import mail_followers
import mail_favorite
import mail_message
import mail_mail
import mail_thread
import mail_group
import mail_vote
import mail_favorite
import res_partner
import res_users
import report
@@ -270,7 +270,7 @@
<field name="signal" groups="base.group_no_one"/>
<field name="start"/>
<field name="object_id" invisible="1"/>
<field name="campaign_id" invisible="1"/>
<field name="campaign_id" invisible="1" required="0"/>
</group>
<group>
<field name="variable_cost"/>
+10 -6
View File
@@ -10,7 +10,11 @@
<form position="attributes">
<attribute name="string">Install Outlook Plug-In</attribute>
</form>
<xpath expr="//footer" position="replace"/>
<xpath expr="//footer" position="replace">
<footer>
<button string="Close" special="Cancel" class="oe_highlight"/>
</footer>
</xpath>
<xpath expr="//separator[@string='title']" position="after" version="7.0">
<group>
<field name="plugin32" widget="url"/>
@@ -19,10 +23,10 @@
<separator string="Installation and Configuration Steps"/>
<p>Click on the link above to download the installer for either 32 or 64 bits, and execute it.</p>
<p>System requirements:</p>
<ul>
<li>1. MS Outlook 2005 or above.</li>
<li>2. MS .Net Framework 3.5 or above.</li>
</ul>
<ol>
<li> MS Outlook 2005 or above.</li>
<li> MS .Net Framework 3.5 or above.</li>
</ol>
</xpath>
<separator string="title" position="attributes">
<attribute name="string"></attribute>
@@ -51,7 +55,7 @@
<div>
<field name="module_plugin_outlook" class="oe_inline"/>
<label for="module_plugin_outlook"/>
<button name="%(action_outlook_installer)d" type="action" string="Download and install the plugin" icon="gtk-execute"
<button name="%(action_outlook_installer)d" type="action" string="Download and install the plug-in" icon="gtk-execute"
attrs="{'invisible': [('module_plugin_outlook','=',False)]}" class="oe_link"/>
</div>
</div>
@@ -30,13 +30,11 @@ class plugin_thunderbird_installer(osv.osv_memory):
'thunderbird': fields.boolean('Thunderbird Plug-in', help="Allows you to select an object that you would like to add to your email and its attachments."),
'plugin_name': fields.char('File name', size=64),
'plugin_file': fields.char('Thunderbird Plug-in', size=256, readonly=True, help="Thunderbird plug-in file. Save this file and install it in Thunderbird."),
'pdf_file': fields.char('Installation Manual', size=256, help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
}
_defaults = {
'thunderbird': True,
'plugin_name': 'openerp_plugin.xpi',
'pdf_file': 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_thunderbird.html',
}
def default_get(self, cr, uid, fields, context=None):
@@ -45,4 +43,4 @@ class plugin_thunderbird_installer(osv.osv_memory):
res['plugin_file'] = base_url + '/plugin_thunderbird/static/openerp_plugin.xpi'
return res
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -10,25 +10,28 @@
<form position="attributes">
<attribute name="string">Install Thunderbird Plug-In</attribute>
</form>
<xpath expr="//footer" position="replace"/>
<xpath expr="//footer" position="replace">
<footer>
<button string="Close" special="Cancel" class="oe_highlight"/>
</footer>
</xpath>
<xpath expr="//separator[@string='title']" position="after">
<group>
<field name="thunderbird" invisible="1"/>
<field name="plugin_name" invisible="1"/>
<field name="plugin_file" filename="plugin_name" widget="url"/>
<field name="pdf_file" widget="url"/>
</group>
<separator string="Installation and Configuration Steps"/>
<p>Thunderbird plugin installation:</p>
<ul>
<li>1. Save the Thunderbird plug-in.</li>
<li>2. From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...</li>
<li>3. Select the plug-in (the file named openerp_plugin.xpi).</li>
<li>4. Click "Install Now".</li>
<li>5. Restart Thunderbird.</li>
<li>6. From the Thunderbird menubar: OpenERP -> Configuration.</li>
<li>7. Configure your openerp server.</li>
</ul>
<p>Thunderbird plug-in installation:</p>
<ol>
<li> Save the Thunderbird plug-in.</li>
<li> From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...</li>
<li> Select the plug-in (the file named openerp_plugin.xpi).</li>
<li> Click "Install Now".</li>
<li> Restart Thunderbird.</li>
<li> From the Thunderbird menubar: OpenERP -> Configuration.</li>
<li> Configure your openerp server.</li>
</ol>
</xpath>
<separator string="title" position="attributes">
<attribute name="string"></attribute>
@@ -57,7 +60,7 @@
<div>
<field name="module_plugin_thunderbird" class="oe_inline"/>
<label for="module_plugin_thunderbird"/>
<button name="%(action_thunderbird_installer)d" type="action" string="Download and install the plugin" icon="gtk-execute"
<button name="%(action_thunderbird_installer)d" type="action" string="Download and install the plug-in" icon="gtk-execute"
attrs="{'invisible': [('module_plugin_thunderbird','=',False)]}" class="oe_link"/>
</div>
</div>
+8 -1
View File
@@ -10,7 +10,14 @@
<field name="view_id" ref="crm_claim.crm_case_claims_tree_view"/>
<field name="context">{"search_default_user_id":'', "stage_type":'claim'}</field>
<field name="search_view_id" ref="crm_claim.view_crm_case_claims_filter"/>
<field name="help">Record and track your customers' claims. Claims may be linked to a sales order or a lot. You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on). Claims may automatically be linked to an email address using the mail gateway module.</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to register a new claim.
</p><p>
You can track your claims from this menu and the action we
will take.
</p>
</field>
</record>
<menuitem name="Claims" id="portal_after_sales_claims" parent="portal.portal_after_sales"
+1 -1
View File
@@ -13,7 +13,7 @@
<field name="view_mode">kanban,calendar,tree,form,graph</field>
<field name="context">{"search_default_upcoming":1}</field>
<field name="search_view_id" ref="event.view_event_search"/>
<field name="help">No public events.</field>
<field name="help">There are no public events.</field>
</record>
<menuitem name="Events" id="portal_company_events" parent="portal.portal_company"
+2 -2
View File
@@ -45,7 +45,7 @@
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="product.product_kanban_view"/>
<field name="search_view_id" ref="product.product_search_form_view"/>
<field name="help">No public products.</field>
<field name="help">There are no public products.</field>
</record>
<record id="action_invoice_tree1" model="ir.actions.act_window">
@@ -65,7 +65,7 @@
<field name="context">{'type':'receipt'}</field>
<field name="search_view_id" ref="account_voucher.view_voucher_filter_customer_pay"/>
<field name="target">current</field>
<field name="help">You don't have any payment.</field>
<field name="help">You don't have any refunds or payments.</field>
</record>
<menuitem name="Quotations" id="portal_quotations" parent="portal.portal_orders"
@@ -42,6 +42,7 @@
<field name="name">Portal Personal Contacts</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
<field eval="0" name="perm_read"/>
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
</record>
+11 -1
View File
@@ -1305,7 +1305,17 @@ class task(base_stage, osv.osv):
msg = _('Task has been <b>delegated</b> to <em>%s</em>.') % (task.user_id.name)
self.message_post(cr, uid, [task.id], body=msg, context=context)
return True
def project_task_reevaluate(self, cr, uid, ids, context=None):
if self.pool.get('res.users').has_group(cr, uid, 'project.group_time_work_estimation_tasks'):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'project.task.reevaluate',
'type': 'ir.actions.act_window',
'target': 'new',
}
return self.do_reopen(cr, uid, ids, context=context)
class project_work(osv.osv):
_name = "project.task.work"
+1 -1
View File
@@ -392,7 +392,7 @@
<button name="do_draft" string="Draft" type="object"
states="cancel,done"/>
-->
<button name="%(action_project_task_reevaluate)d" string="Reactivate" type="action"
<button name="project_task_reevaluate" string="Reactivate" type="object"
states="cancelled,done" context="{'button_reactivate':True}" groups="base.group_user"/>
<button name="action_close" string="Done" type="object"
states="draft,open,pending" groups="base.group_user"/>
+1 -1
View File
@@ -268,7 +268,7 @@
<page string="Incoming Shipments &amp; Invoices">
<group>
<group>
<field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"/>
<field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)" groups="stock.group_locations"/>
<field name="minimum_planned_date"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="shipped" groups="base.group_no_one"/>
+1 -1
View File
@@ -43,7 +43,7 @@ class purchase_config_settings(osv.osv_memory):
'group_costing_method':fields.boolean("Compute product cost price based on average cost",
implied_group='product.group_costing_method',
help="""Allows you to compute product cost price based on average cost."""),
'group_purchase_delivery_address': fields.boolean("Allow a different address for incoming products and invoicings",
'group_purchase_delivery_address': fields.boolean("Allow a different address for incoming products and invoicing",
implied_group='purchase.group_delivery_invoice_address',
help="Allows you to specify different delivery and invoice addresses on a purchase order."),
'module_warning': fields.boolean("Alerts by products or supplier",
+2 -2
View File
@@ -170,8 +170,8 @@
<button name="action_quotation_send" string="Send by Mail" type="object" states="sent" groups="base.group_user"/>
<button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="print_quotation" string="Print" type="object" states="sent" groups="base.group_user"/>
<button name="action_button_confirm" states="draft" string="Confirm" type="object" groups="base.group_user"/>
<button name="action_button_confirm" states="sent" string="Confirm" class="oe_highlight" type="object" groups="base.group_user"/>
<button name="action_button_confirm" states="draft" string="Confirm Sale" type="object" groups="base.group_user"/>
<button name="action_button_confirm" states="sent" string="Confirm Sale" class="oe_highlight" type="object" groups="base.group_user"/>
<button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
attrs="{'invisible': [('invoice_exists', '=', False)]}" groups="base.group_user"/>
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"