Bhumi Thakkar (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-project_long_term-bth
into
lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation.
Requested reviews:
OpenERP R&D Team (openerp-dev)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-project_long_term-bth/+merge/122041
Hello,
AttributeError: View definition error for inherited view
'project_long_term.analytic_account_inherited_phase_form' on model
'account.analytic.account': Element '<xpath
expr="//separator[@name="project_sep"]">' not found in parent view
'analytic.view_account_analytic_account_form'
Reproduce error:
1. Install project_long_term,analytic and account_analytic_analysis modules.
2. Sales => Contract
3. Open any record in form view
Replaced xpath expr='//separator[@name="project_sep"]' position='replace' with
xpath expr='//div[@name="project"]' position='before'
and xpath expr='//separator[@name="project_sep"]' position='after' with <xpath
expr='//div[@name="project"]' position='inside'>
Becuase there is no any project_sep named separator in
analytic.view_account_analytic_account_form.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-project_long_term-bth/+merge/122041
Your team OpenERP R&D Team is requested to review the proposed merge of
lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-project_long_term-bth
into
lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation.
=== modified file 'account_analytic_analysis/__openerp__.py'
--- account_analytic_analysis/__openerp__.py 2012-08-22 13:02:32 +0000
+++ account_analytic_analysis/__openerp__.py 2012-08-30 11:52:24 +0000
@@ -40,6 +40,9 @@
'account_analytic_analysis_menu.xml',
'account_analytic_analysis_cron.xml',
],
+ 'css': [
+ 'static/src/css/analytic.css'
+ ],
'demo': [],
'installable': True,
'auto_install': False,
=== modified file 'account_analytic_analysis/account_analytic_analysis.py'
--- account_analytic_analysis/account_analytic_analysis.py 2012-07-26 10:14:23 +0000
+++ account_analytic_analysis/account_analytic_analysis.py 2012-08-30 11:52:24 +0000
@@ -451,8 +451,8 @@
'real_margin_rate': fields.function(_real_margin_rate_calc, type='float', string='Real Margin Rate (%)',
help="Computes using the formula: (Real Margin / Total Costs) * 100.",
digits_compute=dp.get_precision('Account')),
- 'fix_price_invoices' : fields.boolean('Fix Price Invoices'),
- 'invoice_on_timesheets' : fields.boolean("Invoice On Timesheets"),
+ 'fix_price_invoices' : fields.boolean('Fixed Price'),
+ 'invoice_on_timesheets' : fields.boolean("On Timesheets"),
'month_ids': fields.function(_analysis_all, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'),
'user_ids': fields.function(_analysis_all, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'),
'hours_qtt_est': fields.float('Estimation of Hours to Invoice'),
=== modified file 'account_analytic_analysis/account_analytic_analysis_view.xml'
--- account_analytic_analysis/account_analytic_analysis_view.xml 2012-08-08 10:59:07 +0000
+++ account_analytic_analysis/account_analytic_analysis_view.xml 2012-08-30 11:52:24 +0000
@@ -22,30 +22,27 @@
<xpath expr='//div[@name="duration"]' position="after" version="7.0">
<label for="quantity_max"/>
<div>
- <field name="quantity_max" class="oe_inline"/> / Remaining: <field name="remaining_hours" class="oe_inline"/>
+ <field name="quantity_max" class="oe_inline"/>
</div>
</xpath>
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
- <group name='invoice_on_timesheets' string="Invoice on Timesheets Options" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}" col="4">
- <field name="pricelist_id" attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
- <field name="to_invoice" widget="selection" attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
- </group>
</xpath>
- <xpath expr='//group[@name="master"]' position='after'>
+ <xpath expr='//separator[@name="description"]' position='before'>
<separator name="toinvoice" string="Invoicing"/>
- <table width="100%%">
+ <table class="oe_form_analytic_account">
<tr>
- <th></th>
- <th></th>
- <th><label string="Est.Tot"/></th>
- <th><label string="Invoiced"/></th>
- <th><label string="Remaining"/></th>
- <th><label string="To Invoice"/></th>
+ <th class="oe_grey" width="160px"></th>
+ <th class="oe_grey" width="25px"></th>
+ <th class="oe_grey" width="100px"><label string="Expected"/></th>
+ <th class="oe_grey" width="100px"><label string="Invoiced"/></th>
+ <th class="oe_grey" width="100px"><label string="Remaining"/></th>
+ <th class="oe_grey" width="100px"><label string="To Invoice"/></th>
+ <th width="30px"></th>
<th></th>
</tr><tr>
- <td>
+ <td class="oe_grey">
<label for="fix_price_invoices"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="fix_price_invoices" class="oe_inline"/>
</td><td>
<field class="oe_inline" name="amount_max" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
@@ -56,13 +53,22 @@
</td><td>
<field class="oe_inline" name="fix_price_to_invoice" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
</td><td>
- <button name="%(action_sales_order)d" string="All Sales" type="action" context="{'default_partner_id': [partner_id], 'search_default_partner_id': [partner_id],'search_default_project_id': [active_id],'default_project_id': [active_id]}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
- <button name="open_sale_order_lines" string="Lines To Invoice" type="object" context="{'default_partner_id': [partner_id],'default_project_id': active_id,'search_default_uninvoiced': 1,'search_default_project_id': active_id,'search_default_partner_id': [partner_id]}" attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
+ <button name="open_sale_order_lines"
+ class="oe_link oe_e"
+ string="/" type="object"
+ context="{'default_partner_id': [partner_id],'default_project_id': active_id,'search_default_uninvoiced': 1,'search_default_project_id': active_id,'search_default_partner_id': [partner_id]}"
+ attrs="{'invisible': [('fix_price_to_invoice','=',0)]}"/>
+ </td><td>
+ <button name="%(action_sales_order)d" string="Sale Orders"
+ type="action"
+ class="oe_link"
+ context="{'default_partner_id': [partner_id], 'search_default_partner_id': [partner_id],'search_default_project_id': [active_id],'default_project_id': [active_id]}"
+ attrs="{'invisible': [('fix_price_invoices','=',False)]}"/>
</td>
- </tr><tr attrs="{'invisible':[('use_timesheets','=',False)]}">
- <td>
+ </tr><tr>
+ <td class="oe_grey">
<label for="invoice_on_timesheets"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="invoice_on_timesheets"/>
</td><td>
<field class="oe_inline" name="hours_qtt_est" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
@@ -73,25 +79,44 @@
</td><td>
<field class="oe_inline" name="ca_to_invoice" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
</td><td>
- <button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d" string="All Timesheets" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}" context="{'default_account_id': active_id,'search_default_account_id': active_id}"/>
- <button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d" string="Timesheets to Invoice" type="action" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
+ <button name="%(hr_timesheet_invoice.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice)d"
+ type="action"
+ class="oe_link oe_e"
+ string="/"
+ attrs="{'invisible': [('ca_to_invoice','=',0.0)]}"/>
+
+ </td><td>
+ <button name="%(hr_timesheet.act_hr_timesheet_line_evry1_all_form)d"
+ string="Timesheets" type="action"
+ class="oe_link"
+ attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"
+ context="{'default_account_id': active_id,'search_default_account_id': active_id}"/>
</td>
</tr><tr name='total'>
- <th>
+ <th class="oe_grey">
<label string="Total"/>
- </th><td>
- </td><td>
+ </th><td class="oe_grey">
+ </td><td class="oe_grey">
<field name="est_total" class="oe_inline" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="invoiced_total" class="oe_inline"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="remaining_total" class="oe_inline"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="toinvoice_total" class="oe_inline"/>
</td><td>
</td>
</tr>
</table>
+ <group name='invoice_on_timesheets' attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
+ <field name="pricelist_id"
+ class="oe_inline"
+ attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
+ <field name="to_invoice"
+ class="oe_inline"
+ widget="selection"
+ attrs="{'required': [('invoice_on_timesheets', '=', True)]}"/>
+ </group>
</xpath>
</field>
</record>
=== added directory 'account_analytic_analysis/static'
=== added directory 'account_analytic_analysis/static/src'
=== added directory 'account_analytic_analysis/static/src/css'
=== added file 'account_analytic_analysis/static/src/css/Makefile'
--- account_analytic_analysis/static/src/css/Makefile 1970-01-01 00:00:00 +0000
+++ account_analytic_analysis/static/src/css/Makefile 2012-08-30 11:52:24 +0000
@@ -0,0 +1,3 @@
+analytic.css: analytic.sass
+ sass -t expanded analytic.sass analytic.css
+
=== added file 'account_analytic_analysis/static/src/css/analytic.css'
--- account_analytic_analysis/static/src/css/analytic.css 1970-01-01 00:00:00 +0000
+++ account_analytic_analysis/static/src/css/analytic.css 2012-08-30 11:52:24 +0000
@@ -0,0 +1,15 @@
+@charset "utf-8";
+.openerp .oe_form table.oe_form_analytic_account tr {
+ height: 28px;
+}
+.openerp .oe_form table.oe_form_analytic_account tr td, .openerp .oe_form table.oe_form_analytic_account tr th {
+ vertical-align: middle;
+}
+.openerp .oe_form table.oe_form_analytic_account tr td .oe_form_field_float, .openerp .oe_form table.oe_form_analytic_account tr th .oe_form_field_float {
+ float: right;
+ width: auto !important;
+}
+.openerp .oe_form table.oe_form_analytic_account .oe_grey {
+ background-color: #eeeeee;
+ color: #404040;
+}
=== added file 'account_analytic_analysis/static/src/css/analytic.sass'
--- account_analytic_analysis/static/src/css/analytic.sass 1970-01-01 00:00:00 +0000
+++ account_analytic_analysis/static/src/css/analytic.sass 2012-08-30 11:52:24 +0000
@@ -0,0 +1,15 @@
+@charset "utf-8"
+
+.openerp .oe_form
+ table.oe_form_analytic_account
+ tr
+ height: 28px
+ td,th
+ vertical-align: middle
+ .oe_form_field_float
+ float: right
+ width: auto !important
+ .oe_grey
+ background-color: #eeeeee
+ color: #404040
+
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py 2012-08-15 20:13:20 +0000
+++ analytic/analytic.py 2012-08-30 11:52:24 +0000
@@ -153,9 +153,9 @@
return result
_columns = {
- 'name': fields.char('Account Name', size=128, required=True),
+ 'name': fields.char('Account/Contract Name', size=128, required=True),
'complete_name': fields.function(_complete_name_calc, type='char', string='Full Account Name'),
- 'code': fields.char('Code/Reference', size=24, select=True),
+ 'code': fields.char('Reference', size=24, select=True),
'type': fields.selection([('view','Analytic View'), ('normal','Analytic Account'),('contract','Contract or Project'),('template','Template of Project')], 'Type of Account', required=True,
help="If you select the View Type, it means you won\'t allow to create journal entries using that account.\n"\
"The type 'Analytic account' stands for usual accounts that you only want to use in accounting.\n"\
@@ -171,7 +171,7 @@
'debit': fields.function(_debit_credit_bal_qtty, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),
'credit': fields.function(_debit_credit_bal_qtty, type='float', string='Credit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),
'quantity': fields.function(_debit_credit_bal_qtty, type='float', string='Quantity', multi='debit_credit_bal_qtty'),
- 'quantity_max': fields.float('Maximum Time', help='Sets the higher limit of time to work on the contract.'),
+ 'quantity_max': fields.float('Prepaid Units', help='Sets the higher limit of time to work on the contract.'),
'partner_id': fields.many2one('res.partner', 'Customer'),
'user_id': fields.many2one('res.users', 'Project Manager'),
'manager_id': fields.many2one('res.users', 'Account Manager'),
=== modified file 'analytic/analytic_view.xml'
--- analytic/analytic_view.xml 2012-08-15 22:30:38 +0000
+++ analytic/analytic_view.xml 2012-08-30 11:52:24 +0000
@@ -10,33 +10,35 @@
<sheet string="Analytic Account">
<label for="name" class="oe_edit_only"/>
<h1>
- <field name="name"/>
+ <field name="name" class="oe_inline"/>
</h1>
+ <div name="project"/>
<group>
<group>
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)" attrs="{'required':[('type','=','contract')]}"/>
+ <field name="manager_id"/>
+ <field name="code"/>
+ </group>
+ <group>
+ <field name="type"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract','template'])]}"/>
- <field name="type"/>
<field name="template_id" on_change="on_change_template(template_id,context)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
- </group>
- <group>
- <field name="code"/>
- <field name="manager_id"/>
<field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','<>','view')]}"/>
</group>
</group>
<notebook>
<page string="Contract Information" name="contract_page" attrs="{'invisible':[('type','not in',['contract', 'template'])]}">
- <group name="master">
- <group string="Validity" name="contract">
- <label for="date_start" string="Duration"/>
- <div name="duration">
- <field name="date_start" class="oe_inline"/> - <field name="date" class="oe_inline"/>
- </div>
- </group>
- <group name="project">
- <separator string="Project Management" name="project_sep" invisible="1"/>
- </group>
+ <group string="Renewal" name="contract">
+ <p colspan="2" class="oe_grey oe_edit_only">
+ Once the end date of the contract is
+ passed or the maximum number of service
+ units is reached, the account manager
+ is warned by email to renew the contract.
+ </p>
+ <label for="date" string="End Date"/>
+ <div name="duration">
+ <field name="date" class="oe_inline"/>
+ </div>
</group>
<separator string="Terms and Conditions" name="description"/>
<field name="description"/>
=== modified file 'analytic_contract_hr_expense/analytic_contract_hr_expense_view.xml'
--- analytic_contract_hr_expense/analytic_contract_hr_expense_view.xml 2012-08-08 11:42:35 +0000
+++ analytic_contract_hr_expense/analytic_contract_hr_expense_view.xml 2012-08-30 11:52:24 +0000
@@ -5,12 +5,13 @@
<field name="name">account.analytic.account.form.expense.inherit</field>
<field name="model">account.analytic.account</field>
<field eval="60" name="priority"/>
+ <field name="inherit_id" ref="account_analytic_analysis.account_analytic_account_form_form"/>
<field name="arch" type="xml">
<xpath expr='//tr[@name="total"]' position='before'>
<tr>
- <td>
+ <td class="oe_grey">
<label for="charge_expenses"/>
- </td><td>
+ </td><td class="oe_grey">
<field name="charge_expenses"/>
</td><td>
<field class="oe_form_inline" name="est_expenses" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
@@ -21,10 +22,16 @@
</td><td>
<field class="oe_form_inline" name="expense_to_invoice" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td><td>
- <group>
- <button name="open_hr_expense" string="All Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
- <button name="hr_to_invoice_expense" string="Expenses to Invoice" type="object" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
- </group>
+ <button
+ name="hr_to_invoice_expense"
+ class="oe_link oe_e"
+ string="/" type="object"
+ attrs="{'invisible': [('expense_to_invoice','=',0)]}"/>
+ </td><td>
+ <button
+ name="open_hr_expense"
+ class="oe_link"
+ string="Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td>
</tr>
</xpath>
=== modified file 'analytic_contract_project/analytic_contract_project_view.xml'
--- analytic_contract_project/analytic_contract_project_view.xml 2012-08-08 11:42:35 +0000
+++ analytic_contract_project/analytic_contract_project_view.xml 2012-08-30 11:52:24 +0000
@@ -118,7 +118,7 @@
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field name="priority">50</field>
<field name="arch" type="xml">
- <xpath expr='//field[@name="remaining_hours"]' position='after'>
+ <xpath expr='//field[@name="quantity_max"]' position='after'>
<field name="company_uom_id" readonly="1" class="oe_inline"/>
</xpath>
</field>
=== modified file 'event/event_view.xml'
--- event/event_view.xml 2012-08-15 22:30:38 +0000
+++ event/event_view.xml 2012-08-30 11:52:24 +0000
@@ -244,7 +244,7 @@
<templates>
<t t-name="kanban-box">
<div class="oe_module_vignette">
- <a type="edit" class="oe_module_icon">
+ <a type="open" class="oe_module_icon">
<div class="oe_event_date "><t t-esc="record.date_begin.raw_value.getDate()"/></div>
<div class="oe_event_month_year">
<t t-esc="record.date_begin.raw_value.toString('MMM')"/>
@@ -253,7 +253,7 @@
<div class="oe_event_time"><t t-esc="record.date_begin.raw_value.toString('hh:mm tt')"/></div>
</a>
<div class="oe_module_desc">
- <h4><a type="edit"><field name="name"/></a></h4>
+ <h4><a type="open"><field name="name"/></a></h4>
<p>
<t t-if="record.country_id.raw_value">@<field name="country_id"/><br/></t>
<t t-if="record.user_id.raw_value">Organized by <field name="user_id"/><br/></t>
=== modified file 'hr/hr_view.xml'
--- hr/hr_view.xml 2012-08-13 16:06:57 +0000
+++ hr/hr_view.xml 2012-08-30 11:52:24 +0000
@@ -130,11 +130,11 @@
<t t-name="kanban-box">
<div class="oe_employee_vignette">
<div class="oe_employee_image">
- <a type="edit"><img t-att-src="kanban_image('hr.employee', 'image_medium', record.id.value)" class="oe_employee_picture"/></a>
+ <a type="open"><img t-att-src="kanban_image('hr.employee', 'image_medium', record.id.value)" class="oe_employee_picture"/></a>
</div>
<div class="oe_employee_details">
<h4>
- <a type="edit"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
+ <a type="open"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
</h4>
<ul>
<li id="last_login">
=== modified file 'hr_timesheet/hr_timesheet_view.xml'
--- hr_timesheet/hr_timesheet_view.xml 2012-08-14 12:11:17 +0000
+++ hr_timesheet/hr_timesheet_view.xml 2012-08-30 11:52:24 +0000
@@ -83,11 +83,9 @@
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field name="arch" type="xml">
- <xpath expr='//separator[@name="project_sep"]' position='replace'>
- <separator name="project_sep" string="Project Management" colspan="4"/> <!-- removal of invisible attribute -->
- </xpath>
- <xpath expr='//separator[@name="project_sep"]' position='after'>
+ <xpath expr='//div[@name="project"]' position='inside'>
<field name="use_timesheets"/>
+ <label for="use_timesheets"/>
</xpath>
</field>
</record>
=== modified file 'mail/mail_group_view.xml'
--- mail/mail_group_view.xml 2012-08-15 19:56:52 +0000
+++ mail/mail_group_view.xml 2012-08-30 11:52:24 +0000
@@ -25,10 +25,10 @@
<t t-name="kanban-box">
<div t-attf-class="{record.message_is_follower.raw_value} oe_group_vignette">
<div class="oe_group_image">
- <a type="edit"><img t-att-src="kanban_image('mail.group', 'image_medium', record.id.value)" class="oe_group_photo" tooltip="kanban-description"/></a>
+ <a type="open"><img t-att-src="kanban_image('mail.group', 'image_medium', record.id.value)" class="oe_group_photo" tooltip="kanban-description"/></a>
</div>
<div class="oe_group_details">
- <h4><a type="edit"><field name="name"/></a></h4>
+ <h4><a type="open"><field name="name"/></a></h4>
<ul>
<!-- <li><field name="message_follower_count"/> member(s)</li> -->
<li>
=== modified file 'pad/pad.py'
--- pad/pad.py 2012-08-29 09:36:06 +0000
+++ pad/pad.py 2012-08-30 11:52:24 +0000
@@ -1,42 +1,62 @@
# -*- coding: utf-8 -*-
from osv import fields, osv
import random
+import re
import string
import urllib2
from tools.translate import _
class pad_common(osv.osv_memory):
_name = 'pad.common'
- _pad_fields = []
-
- def pad_content(self, cr, uid, url ,context=None):
- content = urllib2.urlopen('%s/export/html'%url).read()
- return content
def pad_generate_url(self, cr, uid, context=None):
- pad_url_template = self.pool.get('res.users').browse(cr,uid, uid, context).company_id.pad_url_template
+ pad_server = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.pad_server
+ # make sure pad server in the form of http://hostname
+ if not pad_server.startswith('http'):
+ pad_server = 'http://' + pad_server
+ pad_server = pad_server.rstrip('/')
+ # generate a salt
s = string.ascii_uppercase + string.digits
- salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(8)])
- template_vars = {
- 'db' : cr.dbname,
- 'model' : self._name,
- 'salt' : salt,
- }
- url = pad_url_template % template_vars
+ salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
+ # contruct the url
+ url = '%s/p/%s-%s-%s' % (pad_server, cr.dbname, self._name, salt)
return url
+ def pad_get_content(self, cr, uid, url, context=None):
+ content = ''
+ if url:
+ page = urllib2.urlopen('%s/export/html'%url).read()
+ mo = re.search('<body>(.*)</body>',page)
+ if mo:
+ content = mo.group(1)
+ return content
+
# TODO
- # add attribute on columns pad_content_field =
- # override default write to load the content at write and store it in the field
# reverse engineer protocol to be setHtml without using the api key
- # override default get to generate urls
- # override read to generate url and store the content if empty
+ # override read and copy to generate url and store the content if empty
+
+ def default_get(self, cr, uid, fields, context=None):
+ data = super(pad_common, self).default_get(cr, uid, fields, context)
+ for k in fields:
+ field = self._all_columns[k].column
+ if hasattr(field,'pad_content_field'):
+ data[k] = self.pad_generate_url(cr, uid, context=context)
+ return data
+
+ def write(self, cr, uid, ids, vals, context=None):
+ for k,v in vals.items():
+ field = self._all_columns[k].column
+ if hasattr(field,'pad_content_field'):
+ vals[field.pad_content_field] = self.pad_get_content(cr, uid, v, context=context)
+ return super(pad_common, self).write(cr, uid, ids, vals, context=context)
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
- update = [(field,self.pad_generate_url(cr, uid, context)) for field in self._pad_fields]
- default.update(update)
+ for k,v in self._all_columns:
+ field = v.column
+ if hasattr(field,'pad_content_field'):
+ default[k] = self.pad_generate_url(cr, uid, context)
return super(pad_common, self).copy(cr, uid, id, default, context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'pad/res_company.py'
--- pad/res_company.py 2012-08-20 23:40:08 +0000
+++ pad/res_company.py 2012-08-30 11:52:24 +0000
@@ -1,16 +1,11 @@
# -*- coding: utf-8 -*-
from osv import fields, osv
-DEFAULT_PAD_TEMPLATE = 'http://pad.openerp.com/p/%(db)s-%(model)s-%(salt)s'
-DEFAULT_PAD_TEMPLATE = ''
-
class company_pad(osv.osv):
_inherit = 'res.company'
_columns = {
- 'pad_url_template': fields.char('Pad URL Template', size=128, required=True, help="Template used to generate pad URL."),
- }
- _defaults = {
- 'pad_url_template': DEFAULT_PAD_TEMPLATE,
+ 'pad_server': fields.char('Pad Server', help="Etherpad lite server. Example: beta.primarypad.com"),
+ 'pad_key': fields.char('Pad Api Key', help="Etherpad lite api key."),
}
=== modified file 'pad/res_company.xml'
--- pad/res_company.xml 2012-08-09 06:05:16 +0000
+++ pad/res_company.xml 2012-08-30 11:52:24 +0000
@@ -7,7 +7,8 @@
<field name="arch" type="xml">
<xpath expr="//group[@name='account_grp']" position="after">
<group string="Pads">
- <field name="pad_url_template" placeholder="e.g. http://beta.etherpad.org/p/%%(db)s-%%(model)s-%%(salt)s"/>
+ <field name="pad_server" placeholder="e.g. beta.primarypad.org"/>
+ <field name="pad_key"/>
</group>
</xpath>
</field>
=== modified file 'pad/static/src/js/pad.js'
--- pad/static/src/js/pad.js 2012-08-29 09:37:43 +0000
+++ pad/static/src/js/pad.js 2012-08-30 11:52:24 +0000
@@ -16,14 +16,8 @@
var self = this;
var _super = self._super;
_super.apply(self,[val]);
- if (val === false || val === "") {
- self.field_manager.dataset.call('pad_generate_url').then(function(r) {
- _super.apply(self,[r]);
- self.render_value();
- });
- } else {
- self.render_value();
- }
+ this._dirty_flag = true;
+ self.render_value();
},
render_value: function() {
console.log("display");
=== modified file 'pad/static/src/xml/pad.xml'
--- pad/static/src/xml/pad.xml 2012-08-20 23:40:08 +0000
+++ pad/static/src/xml/pad.xml 2012-08-30 11:52:24 +0000
@@ -12,9 +12,6 @@
</t>
<t t-name="FieldPad.unconfigured">
Please configure your etherpad server.<br/>
- OpenERP Entreprise customers may safely use pad.openerp.com as a server using the following template:<br/>
- <blockquote>
- http://pad.openerp.com/p/%(db)s-%(model)s-%(salt)s
- </blockquote>
+ OpenERP Entreprise customers may safely use pad.openerp.com<br/>
</t>
</templates>
=== modified file 'pad_project/project_task.py'
--- pad_project/project_task.py 2012-08-20 23:40:08 +0000
+++ pad_project/project_task.py 2012-08-30 11:52:24 +0000
@@ -5,7 +5,6 @@
class task(osv.osv):
_name = "project.task"
_inherit = ["project.task",'pad.common']
- _pad_fields = ['description_pad']
_columns = {
- 'description_pad': fields.char('Description PAD', size=250)
+ 'description_pad': fields.char('Description PAD', pad_content_field='description')
}
=== modified file 'portal_hr_employees/hr_employee_view.xml'
--- portal_hr_employees/hr_employee_view.xml 2012-08-09 06:05:16 +0000
+++ portal_hr_employees/hr_employee_view.xml 2012-08-30 11:52:24 +0000
@@ -38,7 +38,7 @@
</div>
<div class="oe_employee_details">
<h4>
- <a type="edit"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
+ <a type="open"><field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t></a>
</h4>
<ul>
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
=== modified file 'portal_project_issue/portal_project_issue_view.xml'
--- portal_project_issue/portal_project_issue_view.xml 2012-08-13 16:06:57 +0000
+++ portal_project_issue/portal_project_issue_view.xml 2012-08-30 11:52:24 +0000
@@ -18,7 +18,7 @@
<div class="oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_content">
<div>
- <h1><a type="edit"><field name="name"/></a></h1>
+ <h1><a type="open"><field name="name"/></a></h1>
<field name="partner_id"/> <br/>
<field name="version_id"/>
</div>
=== modified file 'project/project_view.xml'
--- project/project_view.xml 2012-08-28 18:02:37 +0000
+++ project/project_view.xml 2012-08-30 11:52:24 +0000
@@ -245,8 +245,8 @@
<a t-if="record.use_tasks.raw_value" name="%(act_project_project_2_project_task_all)d" type="action"> <field name="task_count"/> Tasks</a>
</div>
<table>
- <tr t-if="record.date.raw_value">
- <th class="oe_kanban_project_fields oe_kanban_project_deadline">Deadline</th>
+ <tr class="oe_kanban_project_fields oe_kanban_project_deadline" t-if="record.date.raw_value">
+ <th>Deadline</th>
<td><field name="date"/></td>
</tr>
<tr class="oe_kanban_project_fields oe_kanban_project_progress">
@@ -688,11 +688,9 @@
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
- <xpath expr='//separator[@name="project_sep"]' position='replace'>
- <separator colspan="4" string="Project Management" name="project_sep"/> <!-- removal of invisible attribute -->
- </xpath>
- <xpath expr='//separator[@name="project_sep"]' position='after'>
+ <xpath expr='//div[@name="project"]' position='inside'>
<field name="use_tasks"/>
+ <label for="use_tasks"/>
</xpath>
</field>
</record>
=== modified file 'project_issue/project_issue_view.xml'
--- project_issue/project_issue_view.xml 2012-08-16 16:31:05 +0000
+++ project_issue/project_issue_view.xml 2012-08-30 11:52:24 +0000
@@ -393,11 +393,9 @@
<field name="inherit_id" ref="project.analytic_account_inherited_form"/>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
- <xpath expr='//separator[@name="project_sep"]' position='replace'>
- <separator colspan="4" string="Project Management" name="project_sep"/> <!-- removal of invisible attribute -->
- </xpath>
- <xpath expr='//separator[@name="project_sep"]' position='after'>
+ <xpath expr='//div[@name="project"]' position='inside'>
<field name="use_issues"/>
+ <label for="use_issues"/>
</xpath>
</field>
</record>
=== modified file 'project_long_term/project_long_term_view.xml'
--- project_long_term/project_long_term_view.xml 2012-08-13 16:06:57 +0000
+++ project_long_term/project_long_term_view.xml 2012-08-30 11:52:24 +0000
@@ -347,11 +347,12 @@
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
- <xpath expr='//separator[@name="project_sep"]' position='replace'>
+ <xpath expr='//div[@name="project"]' position='before'>
<separator name="project_sep" string="Project Management" colspan="4"/> <!-- removal of invisible attribute -->
</xpath>
- <xpath expr='//separator[@name="project_sep"]' position='after'>
+ <xpath expr='//div[@name="project"]' position='inside'>
<field name="use_phases"/>
+ <label for="use_phases" />
</xpath>
</field>
</record>
=== modified file 'project_timesheet/project_timesheet_view.xml'
--- project_timesheet/project_timesheet_view.xml 2012-08-13 16:06:57 +0000
+++ project_timesheet/project_timesheet_view.xml 2012-08-30 11:52:24 +0000
@@ -17,13 +17,16 @@
<a t-if="record.use_timesheets.raw_value"
name="open_timesheets" type="object">Timesheets(<field name="timesheet_count"/>)</a>
</xpath>
- <xpath expr="//div[contains(@class, 'oe_kanban_project_deadline')]" position="before">
- <div class="oe_kanban_project_fields oe_kanban_project_invoice" t-if="record.partner_id.raw_value">
- <div>Amount to invoice</div>
- <div><field name="amount_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/></div>
- <div>Time to Invoice</div>
- <div><field name="time_to_invoice"/> <field name="company_uom_id"/></div>
- </div>
+ <xpath expr="//tr[contains(@class, 'oe_kanban_project_deadline')]" position="before">
+
+ <tr class="oe_kanban_project_fields oe_kanban_project_invoice" t-if="record.partner_id.raw_value">
+ <th>Amount to invoice</th>
+ <td><field name="amount_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/></td>
+ </tr>
+ <tr class="oe_kanban_project_fields oe_kanban_project_invoice" t-if="record.partner_id.raw_value">
+ <th>Time to Invoice</th>
+ <td><field name="time_to_invoice"/> <field name="company_uom_id"/></td>
+ </tr>
</xpath>
</field>
</record>
=== modified file 'stock/product_view.xml'
--- stock/product_view.xml 2012-08-29 09:48:28 +0000
+++ stock/product_view.xml 2012-08-30 11:52:24 +0000
@@ -212,10 +212,10 @@
<t t-name="kanban-box">
<div class="oe_product_vignette">
<div class="oe_product_img">
- <a type="edit"><img t-att-src="kanban_image('product.product', 'image_medium', record.id.value)" class="oe_product_photo"/></a>
+ <a type="open"><img t-att-src="kanban_image('product.product', 'image_medium', record.id.value)" class="oe_product_photo"/></a>
</div>
<div class="oe_product_desc">
- <h4><a type="edit"><field name="name"></field></a></h4>
+ <h4><a type="open"><field name="name"></field></a></h4>
<ul>
<li t-if="record.code.raw_value">Code: <field name="code"/></li>
<li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp