[MERGE]: Merged with lp:openobject-addons

bzr revid: atp@tinyerp.com-20121016171502-ldl0i75wv50sgdyy
This commit is contained in:
Atul Patel (OpenERP) 2012-10-16 22:45:02 +05:30
commit 94bca52631
50 changed files with 3645 additions and 4947 deletions

View File

@ -2768,7 +2768,6 @@ class account_chart_template(osv.osv):
'property_account_income_categ': fields.many2one('account.account.template', 'Income Category Account'),
'property_account_expense': fields.many2one('account.account.template', 'Expense Account on Product Template'),
'property_account_income': fields.many2one('account.account.template', 'Income Account on Product Template'),
'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss: Amount will be deducted.), Which is calculated from Profilt & Loss Report'),
'property_account_income_opening': fields.many2one('account.account.template', 'Opening Entries Income Account'),
'property_account_expense_opening': fields.many2one('account.account.template', 'Opening Entries Expense Account'),
}
@ -3216,7 +3215,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
('property_account_income_categ','product.category','account.account'),
('property_account_expense','product.template','account.account'),
('property_account_income','product.template','account.account'),
('property_reserve_and_surplus_account','res.company','account.account')
]
template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context)
for record in todo_list:

View File

@ -1037,11 +1037,10 @@
-->
<record id="view_move_line_tree_reconcile" model="ir.ui.view">
<field name="name">account.move.line.reconcile.tree</field>
<field name="model">account.move.line</field>
<field eval="24" name="priority"/>
<field name="arch" type="xml">
<tree colors="red:state == 'draft';black:state == 'valid'" string="Journal Items to Reconcile" create="false">
<tree_account_reconciliation colors="red:state == 'draft';black:state == 'valid'" string="Journal Items to Reconcile" create="false" version="7.0">
<field name="date"/>
<field name="move_id"/>
<field name="ref"/>
@ -1049,9 +1048,10 @@
<field name="partner_id"/>
<field name="account_id"/>
<field name="reconcile_partial_id"/>
<field name="state" invisible="1"/>
<field name="debit" sum="Total debit"/>
<field name="credit" sum="Total credit"/>
</tree>
</tree_account_reconciliation>
</field>
</record>
@ -1542,8 +1542,7 @@
<field name="name">Journal Items to Reconcile</field>
<field name="res_model">account.move.line</field>
<field name="view_id" ref="view_move_line_tree_reconcile"/>
<field name="view_type">form</field>
<field name="view_mode">account_reconciliation_list</field>
<field name="view_mode">tree_account_reconciliation</field>
<field name="help" type="html">
<p>
No journal items found.
@ -2171,7 +2170,6 @@
<field name="property_account_income" domain="[('id', 'child_of', [account_root_id])]"/>
<field name="property_account_income_opening" domain="[('id', 'child_of', [account_root_id])]"/>
<field name="property_account_expense_opening" domain="[('id', 'child_of', [account_root_id])]"/>
<field name="property_reserve_and_surplus_account" />
</group>
</form>
</field>

View File

@ -32,14 +32,6 @@ class res_company(osv.osv):
help="If you select 'Round per Line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round Globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."),
'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."),
'overdue_msg': fields.text('Overdue Payments Message', translate=True),
'property_reserve_and_surplus_account': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Reserve and Profit/Loss Account",
view_load=True,
domain="[('type', '=', 'other')]",
help="This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report"),
}
_defaults = {

View File

@ -15,18 +15,5 @@
</field>
</record>
<record model="ir.ui.view" id="view_company_inherit_1_form">
<field name="name">res.company.form.inherit</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="model">res.company</field>
<field name="arch" type="xml">
<xpath expr="//group[@name='account_grp']" position="inside">
<field name="property_reserve_and_surplus_account"/>
<field name="tax_calculation_rounding_method"/>
<field name="paypal_account" placeholder="e.g. sales@openerp.com"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -381,7 +381,6 @@
<field name="property_account_income_categ" ref="conf_a_sale"/>
<field name="property_account_income_opening" ref="conf_o_income"/>
<field name="property_account_expense_opening" ref="conf_o_expense"/>
<field name="property_reserve_and_surplus_account" ref="conf_a_reserve_and_surplus"/>
<field name="complete_tax_set" eval="False"/>
</record>

View File

@ -304,14 +304,6 @@
<field name="company_id" ref="base.main_company"/>
</record>
<record forcecreate="True" id="property_reserve_and_surplus_account" model="ir.property">
<field name="name">property_account_receivable</field>
<field name="fields_id" search="[('model','=','res.company'),('name','=','property_reserve_and_surplus_account')]"/>
<field eval="'account.account,'+str(rsa)" name="value"/>
<field name="company_id" ref="base.main_company"/>
</record>
<!--
Account Journal
-->

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@
##############################################################################
import tools
import decimal_precision as dp
from osv import fields,osv
class account_invoice_report(osv.osv):
@ -27,6 +28,31 @@ class account_invoice_report(osv.osv):
_description = "Invoices Statistics"
_auto = False
_rec_name = 'date'
def _compute_amounts_in_user_currency(self, cr, uid, ids, field_names, args, context=None):
"""Compute the amounts in the currency of the user
"""
if context is None:
context={}
currency_obj = self.pool.get('res.currency')
currency_rate_obj = self.pool.get('res.currency.rate')
user_currency_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
currency_rate_id = currency_rate_obj.search(cr, uid, [('rate', '=', 1)], limit=1, context=context)[0]
base_currency_id = currency_rate_obj.browse(cr, uid, currency_rate_id, context=context).currency_id.id
res = {}
ctx = context.copy()
for item in self.browse(cr, uid, ids, context=context):
ctx['date'] = item.date
price_total = currency_obj.compute(cr, uid, base_currency_id, user_currency_id, item.price_total, context=ctx)
price_average = currency_obj.compute(cr, uid, base_currency_id, user_currency_id, item.price_average, context=ctx)
residual = currency_obj.compute(cr, uid, base_currency_id, user_currency_id, item.residual, context=ctx)
res[item.id] = {
'user_currency_price_total': price_total,
'user_currency_price_average': price_average,
'user_currency_residual': residual,
}
return res
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
@ -47,7 +73,9 @@ class account_invoice_report(osv.osv):
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'user_id': fields.many2one('res.users', 'Salesperson', readonly=True),
'price_total': fields.float('Total Without Tax', readonly=True),
'user_currency_price_total': fields.function(_compute_amounts_in_user_currency, string="Total Without Tax", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
'price_average': fields.float('Average Price', readonly=True, group_operator="avg"),
'user_currency_price_average': fields.function(_compute_amounts_in_user_currency, string="Average Price", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
'currency_rate': fields.float('Currency Rate', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'type': fields.selection([
@ -69,6 +97,7 @@ class account_invoice_report(osv.osv):
'account_line_id': fields.many2one('account.account', 'Account Line',readonly=True),
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual': fields.float('Total Residual', readonly=True),
'user_currency_residual': fields.function(_compute_amounts_in_user_currency, string="Total Residual", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"),
'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg"),
}
@ -161,7 +190,7 @@ class account_invoice_report(osv.osv):
left join product_uom u on (u.id=ail.uos_id),
res_currency_rate cr
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) order by name desc limit 1)
group by ail.product_id,
ai.date_invoice,
ai.id,

View File

@ -28,8 +28,8 @@
<field name="nbr" sum="# of Lines"/>
<field name="product_qty" sum="Qty"/>
<!-- <field name="reconciled" sum="# Reconciled"/> -->
<field name="price_total" sum="Total Without Tax"/>
<field name="residual" sum="Total Residual" invisible="context.get('residual_invisible',False)"/>
<field name="user_currency_price_total" sum="Total Without Tax"/>
<field name="user_currency_residual" sum="Total Residual" invisible="context.get('residual_invisible',False)"/>
<field name="due_delay" sum="Avg. Due Delay" invisible="context.get('residual_invisible',False)"/>
<field name="delay_to_pay" sum="Avg. Delay To Pay" invisible="context.get('residual_invisible',False)"/>
</tree>
@ -42,7 +42,7 @@
<field name="arch" type="xml">
<graph string="Invoices Analysis" type="bar">
<field name="product_id"/>
<field name="price_total"/>
<field name="user_currency_price_total"/>
</graph>
</field>
</record>

View File

@ -129,7 +129,7 @@
</td>
<td>
<para style="terp_default_9">[[ o.title.name or '' ]] [[ o.name ]]</para>
<para style="terp_default_9">[[ display_address(o.partner_id)] ]]</para>
<para style="terp_default_9">[[ display_address(o.partner_id) ]]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>

View File

@ -121,7 +121,7 @@
</div>
<label for="id" string="Features"/>
<div>
<div>
<div name="group_multi_currency">
<field name="group_multi_currency" class="oe_inline"/>
<label for="group_multi_currency"/>
</div>

View File

@ -5,7 +5,7 @@ openerp.account = function (instance) {
instance.web.account = {};
instance.web.views.add('account_reconciliation_list', 'instance.web.account.ReconciliationListView');
instance.web.views.add('tree_account_reconciliation', 'instance.web.account.ReconciliationListView');
instance.web.account.ReconciliationListView = instance.web.ListView.extend({
init: function() {
this._super.apply(this, arguments);
@ -101,7 +101,7 @@ openerp.account = function (instance) {
return self.rpc("/web/action/load", {
action_id: result[1],
context: additional_context
}, function (result) {
}).then(function (result) {
result = result.result;
result.context = _.extend(result.context || {}, additional_context);
result.flags = result.flags || {};

View File

@ -154,7 +154,7 @@
<field name="view_id" ref="view_bank_statement_line_list"/>
</record>
<menuitem action="action_bank_statement_line" id="bank_statement_line" parent="account.menu_finance_bank_and_cash" sequence="20"/>
<menuitem action="action_bank_statement_line" id="bank_statement_line" parent="account.menu_finance_bank_and_cash" sequence="20" groups="base.group_no_one"/>
</data>
</openerp>

View File

@ -42,6 +42,21 @@ class res_company(osv.osv):
res_company()
class account_config_settings(osv.osv_memory):
_inherit = 'account.config.settings'
_columns = {
'income_currency_exchange_account_id': fields.related(
'company_id', 'income_currency_exchange_account_id',
type='many2one',
relation='account.account',
string="Gain Exchange Rate Account"),
'expense_currency_exchange_account_id': fields.related(
'company_id', 'expense_currency_exchange_account_id',
type="many2one",
relation='account.account',
string="Loss Exchange Rate Account"),
}
class account_voucher(osv.osv):
def _check_paid(self, cr, uid, ids, name, args, context=None):
res = {}

View File

@ -249,16 +249,23 @@
</field>
</record>
<!-- res.company form view -->
<record model="ir.ui.view" id="view_company_inherit_currency_xchange_form">
<field name="name">res.company.form.inherit</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="model">res.company</field>
<!-- res.config form view -->
<record model="ir.ui.view" id="view_account_settings_currency_xchange_form">
<field name="name">account.config.settings.inherit</field>
<field name="inherit_id" ref="account.view_account_config_settings"/>
<field name="model">account.config.settings</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field name="income_currency_exchange_account_id"/>
<field name="expense_currency_exchange_account_id"/>
</field>
<xpath expr="//div[@name='group_multi_currency']" position="after">
<group attrs="{'invisible': [('group_multi_currency', '&lt;&gt;', True)]}" col="2">
<group>
<field name="income_currency_exchange_account_id"/>
<field name="expense_currency_exchange_account_id"/>
</group>
<group>
</group>
</group>
</xpath>
</field>
</record>

View File

@ -69,7 +69,7 @@ instance.web.Login = instance.web.Login.extend({
_check_error: function() {
var self = this;
if (this.params.loginerror !== undefined) {
this.rpc('/auth_openid/login/status', {}, function(result) {
this.rpc('/auth_openid/login/status', {}).then(function(result) {
if (_.contains(['success', 'failure'], result.status) && result.message) {
self.do_warn('Invalid OpenID Login', result.message);
}
@ -106,7 +106,7 @@ instance.web.Login = instance.web.Login.extend({
do_openid_login: function(db, openid_url) {
var self = this;
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}, function(result) {
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).then(function(result) {
if (result.error) {
self.do_warn(result.title, result.error);
return;

View File

@ -46,7 +46,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
delete(action.attrs.colspan);
var action_id = _.str.toNumber(action.attrs.name);
if (!_.isNaN(action_id)) {
self.rpc('/web/action/load', {action_id: action_id}, function(result) {
self.rpc('/web/action/load', {action_id: action_id}).then(function(result) {
self.on_load_action(result, column_index + '_' + action_index, action.attrs);
});
}
@ -81,7 +81,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
this.rpc('/web/view/undo_custom', {
view_id: this.view.fields_view.view_id,
reset: true
}, this.do_reload);
}).then(this.do_reload);
},
on_change_layout: function() {
var self = this;
@ -382,7 +382,7 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
domain: domain,
view_mode: view_parent.active_view,
name: this.$el.find("input").val()
}, function(r) {
}).then(function(r) {
if (r === false) {
self.do_warn("Could not add filter to dashboard");
} else {

View File

@ -170,7 +170,7 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter string="Salesman" position="after">
<filter string="Salesperson" position="after">
<filter string="Activation" context="{'group_by' : 'activation'}" domain="[]" icon="terp-personal" />
</filter>
</field>

View File

@ -15,7 +15,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
this._super();
var self = this;
var param = {"db": self.db, "token": self.token};
return self.rpc('/edi/get_edi_document', param, this.on_document_loaded, this.on_document_failed);
return self.rpc('/edi/get_edi_document', param).then(this.on_document_loaded, this.on_document_failed);
},
on_document_loaded: function(docs){
this.doc = docs[0];
@ -149,11 +149,11 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
},
do_import: function() {
this.rpc('/edi/import_edi_url', {url: this.url}, this.on_imported, this.on_imported_error);
this.rpc('/edi/import_edi_url', {url: this.url}).then(this.on_imported, this.on_imported_error);
},
on_imported: function(response) {
if ('action' in response) {
this.rpc("/web/session/save_session_action", {the_action: response.action}, function(key) {
this.rpc("/web/session/save_session_action", {the_action: response.action}).then(function(key) {
window.location = "/#sa="+encodeURIComponent(key);
});
}

View File

@ -19,6 +19,7 @@
#
##############################################################################
from datetime import datetime, timedelta
from osv import fields, osv
from tools.translate import _
from openerp import SUPERUSER_ID
@ -281,6 +282,15 @@ class event_event(osv.osv):
})
return {'value' : values}
def onchange_start_date(self, cr, uid, ids, date_begin=False, date_end=False, context=None):
res = {'value':{}}
if date_end:
return res
if date_begin and isinstance(date_begin, str):
date_begin = datetime.strptime(date_begin, "%Y-%m-%d %H:%M:%S")
date_end = date_begin + timedelta(hours=1)
res['value'] = {'date_end': date_end.strftime("%Y-%m-%d %H:%M:%S")}
return res
# ----------------------------------------
# OpenChatter methods and notifications

View File

@ -131,7 +131,7 @@
</group>
<group>
<field name="type" on_change="onchange_event_type(type,context)" />
<field name="date_begin"/>
<field name="date_begin" on_change="onchange_start_date(date_begin,date_end)"/>
<field name="date_end"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>

View File

@ -22,7 +22,7 @@ var _t = instance.web._t;
var form = self.getParent();
form.sidebar_context().then(function (context) {
var ds = new instance.web.DataSet(this, 'ir.attachment', context);
ds.call('google_doc_get', [form.dataset.model, [form.datarecord.id], context], function(r) {
ds.call('google_doc_get', [form.dataset.model, [form.datarecord.id], context]).then(function(r) {
if (r == 'False') {
var params = {
error: response,
@ -35,7 +35,7 @@ var _t = instance.web._t;
}
form.reload();
});
})
});
}
})
}
});
};

View File

@ -36,9 +36,11 @@
<page string="Public Information">
<group>
<group string="Contact Information">
<field name="address_id" on_change="onchange_address_id(address_id)" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>
<field name="work_email" widget="email"/>
<field name="work_phone"/>
<field name="mobile_phone"/>
<field name="work_location"/>
</group>
<group string="Position">
<field name="department_id" on_change="onchange_department_id(department_id)"/>
@ -49,7 +51,6 @@
<group>
<field name="company_id" groups="base.group_multi_company" on_change="onchange_company(company_id)"/>
<field name="user_id" on_change="onchange_user(user_id)" string="Related User"/>
<field name="address_id" on_change="onchange_address_id(address_id)" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>
</group>
</group>
<field name="notes" placeholder="Other Information ..." colspan="4"/>

View File

@ -55,11 +55,11 @@
<sheet>
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(employee_id)"/></h1>
<label for="date_from" class="oe_edit_only" string="Timesheet Period"/>
<h2>From <field name="date_from"/> to <field name="date_to"/></h2>
<group>
<group>
<field name="name"/>
<label for="date_from" string="Timesheet Period"/>
<div><field name="date_from"/> to <field name="date_to"/></div>
<field name="name" invisible="1"/>
<field name="department_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>

View File

@ -11807,7 +11807,6 @@
<field name="property_account_income" ref="ch_3200"/>
<field name="property_account_income_opening" ref="ch_2990"/>
<field name="property_account_expense_opening" ref="ch_2990"/>
<field name="property_reserve_and_surplus_account" ref="ch_2991"/>
</record>
<!-- journal configuration of account -->

View File

@ -957,7 +957,6 @@
<field name="property_account_payable" ref="chart2202"/>
<field name="property_account_expense_categ" ref="chart1401"/>
<field name="property_account_income_categ" ref="chart6001"/>
<field name="property_reserve_and_surplus_account" ref="chart4103"/>
</record>
<!-- 增值税 -->
<record id="vats" model="account.tax.template">

View File

@ -441,7 +441,6 @@
<field name="property_account_payable" ref="fr_pcg_pay"/>
<field name="property_account_expense_categ" ref="pcg_6071"/>
<field name="property_account_income_categ" ref="pcg_7071"/>
<field name="property_reserve_and_surplus_account" ref="pcg_120"/>
</record>
</data>

View File

@ -35,7 +35,6 @@
<field name="bank_account_view_id" ref="cta1101"/>
<field name="property_account_receivable" ref="cta110201"/>
<field name="property_account_payable" ref="cta210101"/>
<field name="property_reserve_and_surplus_account" ref="cta310103"/>
<field name="property_account_income_categ" ref="cta410101"/>
<field name="property_account_expense_categ" ref="cta510101"/>
</record>

View File

@ -21,7 +21,6 @@
<field name="bank_account_view_id" ref="cta1101"/>
<field name="property_account_receivable" ref="cta110201"/>
<field name="property_account_payable" ref="cta210101"/>
<field name="property_reserve_and_surplus_account" ref="cta310103"/>
<field name="property_account_income_categ" ref="cta410101"/>
<field name="property_account_expense_categ" ref="cta510101"/>
</record>

View File

@ -514,7 +514,6 @@
<field name="property_account_payable" ref="a215"/>
<field name="property_account_expense_categ" ref="a540"/>
<field name="property_account_income_categ" ref="a311"/>
<field name="property_reserve_and_surplus_account" ref="a260"/>
</record>

View File

@ -668,7 +668,6 @@
<field name="property_account_payable" ref="p21000"/>
<field name="property_account_expense_categ" ref="p41010"/>
<field name="property_account_income_categ" ref="p31010"/>
<field name="property_reserve_and_surplus_account" ref="p24600"/>
</record>
</data>

View File

@ -4102,7 +4102,6 @@
<field name="property_account_payable" ref="a_pay"/> <!-- crediteuren -->
<field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen -->
<field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening -->
<field name="property_reserve_and_surplus_account" ref="a_9999"/>
</record>
<!-- BTW Template

View File

@ -1,2 +1,2 @@
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id","property_reserve_and_surplus_account:id"
"l10n_uk","UK Tax and Account Chart Template (by SmartMode)","UK0","0","1200","1100","2100","5000","4000","3200"
"id","name","account_root_id:id","tax_code_root_id:id","bank_account_view_id:id","property_account_receivable:id","property_account_payable:id","property_account_expense_categ:id","property_account_income_categ:id"
"l10n_uk","UK Tax and Account Chart Template (by SmartMode)","UK0","0","1200","1100","2100","5000","4000"

1 id name account_root_id:id tax_code_root_id:id bank_account_view_id:id property_account_receivable:id property_account_payable:id property_account_expense_categ:id property_account_income_categ:id property_reserve_and_surplus_account:id
2 l10n_uk UK Tax and Account Chart Template (by SmartMode) UK0 0 1200 1100 2100 5000 4000 3200

View File

@ -1895,7 +1895,6 @@
<field name="property_account_payable" ref="uy_code_21100"/>
<field name="property_account_income_categ" ref="uy_code_4100"/>
<field name="property_account_expense_categ" ref="uy_code_5100"/>
<field name="property_reserve_and_surplus_account" ref="uy_code_3313"/>
</record>

View File

@ -1155,14 +1155,7 @@ openerp.mail = function(session) {
_check_visibility: function() {
this.$el.toggle(this.view.get("actual_mode") !== "create");
},
/**
* Reinitialize the widget field and Display the threads
* @param {Object} new_context: context of the refresh
*/
set_value: function() {
var self = this;
this._super.apply(this, arguments);
render_value: function() {
if (! this.view.datarecord.id || session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) {
this.$('oe_mail_thread').hide();
return;
@ -1267,7 +1260,7 @@ openerp.mail = function(session) {
domains: domains || [],
contexts: contexts || [],
group_by_seq: groupbys || []
}, function (results) {
}).then(function (results) {
self.search_results['context'] = results.context;
self.search_results['domain'] = results.domain;
self.thread.destroy();

View File

@ -88,9 +88,9 @@ openerp_mail_followers = function(session, mail) {
});
},
set_value: function(value_) {
render_value: function() {
this.reinit();
return this.fetch_followers(value_ || this.get_value());
return this.fetch_followers(this.get("value"));
},
set_is_follower: function(value_) {

View File

@ -274,6 +274,17 @@ class mrp_bom(osv.osv):
return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}}
return {}
def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None):
res = {'value':{}}
if not product_uom or not product_id:
return res
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context)
if uom.category_id.id != product.uom_id.category_id.id:
res['warning'] = {'title': _('Warning'), 'message': _('The Product Unit of Measure you chose has a different category than in the product form.')}
res['value'].update({'product_uom': product.uom_id.id})
return res
def _bom_find(self, cr, uid, product_id, product_uom, properties=None):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.

View File

@ -351,7 +351,7 @@
<label for="product_qty" string="Quantity"/>
<div>
<field name="product_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" groups="product.group_uom"/>
<field name="product_uom" class="oe_inline" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
</div>
<label for="product_uos_qty" groups="product.group_uos"/>
<div groups="product.group_uos" >
@ -382,7 +382,7 @@
<tree string="Components" editable="bottom">
<field name="product_id" on_change="onchange_product_id(product_id, name)"/>
<field name="product_qty"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="name" invisible="1"/>
<field name="date_start"/>
<field name="date_stop"/>

View File

@ -22,6 +22,7 @@
from osv import fields
from osv import osv
import decimal_precision as dp
from tools.translate import _
class mrp_subproduct(osv.osv):
_name = 'mrp.subproduct'
@ -51,6 +52,17 @@ class mrp_subproduct(osv.osv):
return {'value': v}
return {}
def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None):
res = {'value':{}}
if not product_uom or not product_id:
return res
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context)
if uom.category_id.id != product.uom_id.category_id.id:
res['warning'] = {'title': _('Warning'), 'message': _('The Product Unit of Measure you chose has a different category than in the product form.')}
res['value'].update({'product_uom': product.uom_id.id})
return res
mrp_subproduct()
class mrp_bom(osv.osv):

View File

@ -11,13 +11,13 @@
<field name="sub_products">
<tree string="sub products" editable="top">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="product_qty"/>
<field name="subproduct_type"/>
</tree>
<form string="Sub Products">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
<field name="product_qty"/>
<field name="subproduct_type"/>
</form>

View File

@ -4,16 +4,13 @@ openerp.pad = function(instance) {
template: 'FieldPad',
configured: false,
content: "",
set_value: function(val) {
render_value: function() {
var self = this;
var _super = self._super;
_super.apply(self,[val]);
if (val === false || val === "") {
self.field_manager.dataset.call('pad_generate_url',{context:{
model: self.field_manager.model,
if (this.get("value") === false || this.get("value") === "") {
self.view.dataset.call('pad_generate_url',{context:{
model: self.view.model,
field_name: self.name,
object_id: self.field_manager.datarecord.id
object_id: self.view.datarecord.id
}}).then(function(data) {
if(data&&data.url){
_super.apply(self,[data.url]);

View File

@ -37,8 +37,7 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
callbacks[i](params);
}
this.connection.rpc('/pos/'+name, params || {},
function(result){
this.connection.rpc('/pos/'+name, params || {}).then(function(result){
ret.resolve(result);
},
function(error){

View File

@ -216,13 +216,12 @@ instance.web.ViewManager.include({
var dataset = new instance.web.DataSet(this, 'ir.values', this.session.user_context);
var action_manager = new instance.web.ActionManager(self);
dataset.call('get',
['action', 'tree_but_open',[['ir.ui.menu', id]], dataset.context],
function(res) {
['action', 'tree_but_open',[['ir.ui.menu', id]], dataset.context]).then(function(res) {
var action = res[0][res[0].length - 1];
self.rpc("/web/action/load", {
action_id: action.id,
context: dataset.context
}, function(result) {
}).then(function(result) {
action_manager.replace(self.$el);
action_manager.do_action(result.result);
})

View File

@ -13,7 +13,7 @@
<filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
<separator/>
<filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
<field name="categ_id" operator="child_of"/>
<field name="categ_id"/>
<group expand="0" string="Context...">
<field name="pricelist_id" context="{'pricelist': self}" groups="product.group_sale_pricelist"/>
<field name="company_id" groups="base.group_multi_company"/>

View File

@ -135,7 +135,7 @@
<field name="resource_calendar_id"/>
</group>
<group string="Miscellaneous" name="misc">
<field name="date"/>
<field name="date" string="End Date"/>
<field name="priority" groups="base.group_no_one"/>
<field name="active" attrs="{'invisible':[('state','in',['open', 'pending', 'template'])]}"/>

View File

@ -42,10 +42,10 @@
</record>
<record model="ir.rule" id="project_public_members_rule">
<field name="name">public Members</field>
<field name="name">Public Members</field>
<field name="model_id" ref="model_project_project"/>
<field name="global" eval="True"/>
<field name="domain_force">['|','|',('privacy_visibility','in',[False,'public']),('members','in',[user.id]),('message_follower_ids','in',[user.partner_id.id])]</field>
<field name="domain_force">['|',('privacy_visibility','in',[False,'public']),('message_follower_ids','in',[user.partner_id.id])]</field>
</record>
<record model="ir.rule" id="task_comp_rule">

View File

@ -78,8 +78,6 @@
<field name="arch" type="xml">
<field name="remaining_hours" position="after">
<field string="Timebox" name="timebox_id" invisible=" not context.get('gtd', False)"/>
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
<field name="context_id" invisible="not context.get('context_show', False)" widget="selection"/>
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks" invisible="not context.get('set_visible',False)"/>
</field>
@ -123,7 +121,7 @@
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, "search_default_open": 1}</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,gantt,graph,kanban</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
</record>
<menuitem action="open_gtd_task" id="menu_open_gtd_timebox_tree" parent="project.menu_project_management" sequence="10"/>

View File

@ -438,16 +438,6 @@
<field name="search_view_id" ref="view_sales_order_filter"/>
</record>
<record id="view_order_line_graph" model="ir.ui.view">
<field name="name">sale.order.line.graph</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<graph string="Sales Order Lines">
<field name="product_id"/>
<field name="price_subtotal" operator="+"/>
</graph>
</field>
</record>
<record id="view_order_line_tree" model="ir.ui.view">
<field name="name">sale.order.line.tree</field>
@ -558,7 +548,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
<field name="context">{"search_default_uninvoiced":1}</field>
<field name="filter" eval="True"/>
@ -577,7 +567,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
<field name="filter" eval="True"/>
</record>

View File

@ -15,7 +15,7 @@ openerp.share = function(session) {
self.rpc('/web/session/eval_domain_and_context', {
domains: [domain],
contexts: [view.dataset.context]
}, function (result) {
}).then(function (result) {
Share.create({
name: action.name,
record_name: rec_name,
@ -24,9 +24,8 @@ openerp.share = function(session) {
user_type: user_type || 'embedded',
view_type: view.fields_view.type,
invite: invite || false,
}, function(result) {
var share_id = result.result;
var step1 = Share.call('go_step_1', [[share_id],], function(result) {
}).then(function(share_id) {
var step1 = Share.call('go_step_1', [[share_id]]).then(function(result) {
var action = result;
self.do_action(action);
});

View File

@ -46,7 +46,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
load: function() {
var self = this;
this.$el.find('.oe_systray_shortcuts_items').empty();
return this.rpc('/web/shortcuts/list', {}, function(shortcuts) {
return this.rpc('/web/shortcuts/list', {}).then(function(shortcuts) {
_.each(shortcuts, function(sc) {
self.trigger('display', sc);
});
@ -80,7 +80,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
id = $link.data('id');
self.session.active_id = id;
// TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'})
self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) {
self.rpc('/web/menu/action', {'menu_id': id}).then(function(ir_menu_data) {
if (ir_menu_data.action.length){
instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id});
}