[MERGE] 30 merge props
bzr revid: fp@tinyerp.com-20121112104524-ytd1d0c4tz0fbd01
This commit is contained in:
@@ -983,13 +983,13 @@ class account_invoice(osv.osv):
|
||||
for i in line:
|
||||
i[2]['period_id'] = period_id
|
||||
|
||||
ctx.update(invoice=inv)
|
||||
move_id = move_obj.create(cr, uid, move, context=ctx)
|
||||
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
|
||||
# make the invoice point to that move
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
|
||||
# Pass invoice in context in method post: used if you want to get the same
|
||||
# account move reference when creating the same invoice after a cancelled one:
|
||||
ctx.update({'invoice':inv})
|
||||
move_obj.post(cr, uid, [move_id], context=ctx)
|
||||
self._log_event(cr, uid, ids)
|
||||
return True
|
||||
|
||||
@@ -208,7 +208,7 @@ class account_move_line(osv.osv):
|
||||
if type(period_id) == str:
|
||||
ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
|
||||
context.update({
|
||||
'period_id': ids[0]
|
||||
'period_id': ids and ids[0] or False
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
@@ -41,13 +41,5 @@
|
||||
groups="group_account_user,group_account_manager"
|
||||
parent="account.menu_finance_generic_reporting" sequence="3"/>
|
||||
|
||||
<report id="account_account_balance_landscape"
|
||||
string="Account balance"
|
||||
model="account.account"
|
||||
name="account.account.balance.landscape"
|
||||
rml="account/report/account_balance_landscape.rml"
|
||||
auto="False"
|
||||
menu="False"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -170,12 +170,12 @@
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]]</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filters' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
|
||||
@@ -299,10 +299,10 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def _get_sortby(self, data):
|
||||
if self.sortby == 'sort_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif self.sortby == 'sort_journal_partner':
|
||||
return 'Journal & Partner'
|
||||
return 'Date'
|
||||
return self._translate('Journal & Partner')
|
||||
return self._translate('Date')
|
||||
|
||||
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal')
|
||||
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape')
|
||||
|
||||
@@ -94,10 +94,10 @@ class common_report_header(object):
|
||||
def _get_filter(self, data):
|
||||
if data.get('form', False) and data['form'].get('filter', False):
|
||||
if data['form']['filter'] == 'filter_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif data['form']['filter'] == 'filter_period':
|
||||
return 'Periods'
|
||||
return 'No Filter'
|
||||
return self._translate('Periods')
|
||||
return self._translate('No Filters')
|
||||
|
||||
def _sum_debit_period(self, period_id, journal_id=None):
|
||||
journals = journal_id or self.journal_ids
|
||||
|
||||
@@ -226,7 +226,7 @@ class account_fiscalyear_close(osv.osv_memory):
|
||||
for account in obj_acc_account.browse(cr, uid, account_ids, context={'fiscalyear': fy_id}):
|
||||
balance_in_currency = 0.0
|
||||
if account.currency_id:
|
||||
cr.execute('SELECT sum(amount_currency) as balance_in_currency FROM account_move_line ' \
|
||||
cr.execute('SELECT sum(COALESCE(amount_currency,0.0)) as balance_in_currency FROM account_move_line ' \
|
||||
'WHERE account_id = %s ' \
|
||||
'AND ' + query_line + ' ' \
|
||||
'AND currency_id = %s', (account.id, account.currency_id.id))
|
||||
|
||||
@@ -119,7 +119,11 @@ class account_common_report(osv.osv_memory):
|
||||
|
||||
def _get_fiscalyear(self, cr, uid, context=None):
|
||||
now = time.strftime('%Y-%m-%d')
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
|
||||
company_id = None
|
||||
ids = context.get('active_ids', [])
|
||||
for wiz in self.browse(cr, uid, ids, context=context):
|
||||
company_id = wiz.company_id
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1 )
|
||||
return fiscalyears and fiscalyears[0] or False
|
||||
|
||||
def _get_all_journal(self, cr, uid, context=None):
|
||||
|
||||
@@ -21,17 +21,17 @@
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/form/notebook/page/group/group/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="journal_col11" model="account.journal.column">
|
||||
<field eval=""""Analytic Distribution"""" name="name"/>
|
||||
<field eval="11" name="sequence"/>
|
||||
<field eval="15" name="sequence"/>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field eval="0" name="required"/>
|
||||
<field eval=""""analytics_id"""" name="field"/>
|
||||
|
||||
@@ -40,7 +40,7 @@ class account_invoice_line(osv.osv):
|
||||
|
||||
if inv.type in ('out_invoice','out_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if inv.type == 'out_invoice':
|
||||
# debit account dacc will be the output account
|
||||
# first check the product, if empty check the category
|
||||
@@ -87,7 +87,7 @@ class account_invoice_line(osv.osv):
|
||||
})
|
||||
elif inv.type in ('in_invoice','in_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if i_line.product_id.type != 'service':
|
||||
# get the price difference account at the product
|
||||
acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id
|
||||
|
||||
@@ -43,6 +43,18 @@
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="sequence_journal" model="ir.sequence.type">
|
||||
<field name="name">Account Journal</field>
|
||||
<field name="code">account.journal</field>
|
||||
</record>
|
||||
|
||||
<record id="sequence_journal_seq" model="ir.sequence">
|
||||
<field name="name">Account journal sequence</field>
|
||||
<field name="code">account.journal</field>
|
||||
<field name="prefix">AJ</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
</openerp>
|
||||
|
||||
@@ -953,6 +953,9 @@ class account_voucher(osv.osv):
|
||||
if voucher_brw.number:
|
||||
name = voucher_brw.number
|
||||
elif voucher_brw.journal_id.sequence_id:
|
||||
if not voucher_brw.journal_id.sequence_id.active:
|
||||
raise osv.except_osv(_('Configuration Error !'),
|
||||
_('Please activate the sequence of selected journal !'))
|
||||
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
|
||||
<field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="context">{'default_type':'receipt', 'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="view_id" ref="view_vendor_receipt_form"/>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
@@ -388,6 +388,8 @@ class audittrail_objects_proxy(object_proxy):
|
||||
}
|
||||
# loop on all the fields
|
||||
for field_name, field_definition in pool.get(model.model)._all_columns.items():
|
||||
if field_name in ('__last_update', 'id'):
|
||||
continue
|
||||
#if the field_list param is given, skip all the fields not in that list
|
||||
if field_list and field_name not in field_list:
|
||||
continue
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="object_id" readonly="1"/>
|
||||
</group>
|
||||
<field name="line_ids" mode="tree,form"
|
||||
<field name="line_ids" mode="tree"
|
||||
widget="one2many_list" readonly="1">
|
||||
<form string="Log Lines" version="7.0">
|
||||
<group col="4">
|
||||
|
||||
@@ -823,6 +823,7 @@ class node_res_dir(node_class):
|
||||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
ctx.update(self.context.extra_ctx)
|
||||
where = []
|
||||
if self.domain:
|
||||
app = safe_eval(self.domain, ctx)
|
||||
|
||||
@@ -43,7 +43,7 @@ class showdiff(osv.osv_memory):
|
||||
|
||||
elif len(ids) == 1:
|
||||
old = history.browse(cr, uid, ids[0])
|
||||
nids = history.search(cr, uid, [('document_id', '=', old.document_id.id)])
|
||||
nids = history.search(cr, uid, [('page_id', '=', old.page_id.id)])
|
||||
nids.sort()
|
||||
diff = history.getDiff(cr, uid, ids[0], nids[-1])
|
||||
else:
|
||||
|
||||
@@ -51,9 +51,10 @@ class document_davdir(osv.osv):
|
||||
# that might be not worth preparing.
|
||||
nctx.extra_ctx['webdav_path'] = '/'+config.get_misc('webdav','vdir','webdav')
|
||||
usr_obj = self.pool.get('res.users')
|
||||
res = usr_obj.read(cr, uid, uid, ['login'])
|
||||
res = usr_obj.read(cr, uid, uid, ['login','context_lang'])
|
||||
if res:
|
||||
nctx.extra_ctx['username'] = res['login']
|
||||
nctx.extra_ctx['lang'] = res['context_lang']
|
||||
# TODO group
|
||||
return
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ from report.interface import toxml
|
||||
from report import report_sxw
|
||||
from tools import ustr
|
||||
from tools.translate import _
|
||||
from tools import to_xml
|
||||
|
||||
one_day = relativedelta(days=1)
|
||||
month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||
@@ -111,7 +112,7 @@ class report_custom(report_rml):
|
||||
<date>%s</date>
|
||||
<company>%s</company>
|
||||
</header>
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name))
|
||||
|
||||
first_date = str(month)
|
||||
som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
|
||||
|
||||
@@ -31,6 +31,7 @@ import time
|
||||
from report import report_sxw
|
||||
from tools import ustr
|
||||
from tools.translate import _
|
||||
from tools import to_xml
|
||||
|
||||
def lengthmonth(year, month):
|
||||
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
|
||||
@@ -240,7 +241,7 @@ class report_custom(report_rml):
|
||||
<date>%s</date>
|
||||
<company>%s</company>
|
||||
</header>
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name))
|
||||
|
||||
# Computing the xml
|
||||
xml='''<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
@@ -326,6 +326,7 @@ class hr_payslip(osv.osv):
|
||||
return self.write(cr, uid, ids, {'paid': True, 'state': 'done'}, context=context)
|
||||
|
||||
def hr_verify_sheet(self, cr, uid, ids, context=None):
|
||||
self.compute_sheet(cr, uid, ids, context)
|
||||
return self.write(cr, uid, ids, {'state': 'verify'}, context=context)
|
||||
|
||||
def refund_sheet(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -28,6 +28,7 @@ import time
|
||||
import pooler
|
||||
from report import report_sxw
|
||||
from tools import ustr
|
||||
from tools import to_xml
|
||||
|
||||
def lengthmonth(year, month):
|
||||
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
|
||||
@@ -94,7 +95,7 @@ class report_custom(report_rml):
|
||||
<date>%s</date>
|
||||
<company>%s</company>
|
||||
</header>
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name)
|
||||
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name))
|
||||
|
||||
account_xml = []
|
||||
for account, telems in accounts.iteritems():
|
||||
|
||||
@@ -27,8 +27,9 @@ class analytical_timesheet_employee(osv.osv_memory):
|
||||
_name = 'hr.analytical.timesheet.employee'
|
||||
_description = 'Print Employee Timesheet & Print My Timesheet'
|
||||
_columns = {
|
||||
'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
|
||||
'Month', required=True),
|
||||
'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'),
|
||||
(5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'),
|
||||
(10,'October'), (11,'November'), (12,'December')], 'Month', required=True),
|
||||
'year': fields.integer('Year', required=True),
|
||||
'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
|
||||
|
||||
|
||||
@@ -27,8 +27,9 @@ class analytical_timesheet_employees(osv.osv_memory):
|
||||
_name = 'hr.analytical.timesheet.users'
|
||||
_description = 'Print Employees Timesheet'
|
||||
_columns = {
|
||||
'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
|
||||
'Month', required=True),
|
||||
'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'),
|
||||
(5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'),
|
||||
(10,'October'), (11,'November'), (12,'December')], 'Month', required=True),
|
||||
'year': fields.integer('Year', required=True),
|
||||
'employee_ids': fields.many2many('hr.employee', 'timesheet_employee_rel', 'timesheet_id', 'employee_id', 'employees', required=True)
|
||||
}
|
||||
|
||||
@@ -52,21 +52,6 @@ class ResPartnerBank(osv.osv):
|
||||
'my_bank': fields.boolean('Use my account to print BVR ?', help="Check to print BVR invoices"),
|
||||
}
|
||||
|
||||
def name_get(self, cursor, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
return []
|
||||
bank_type_obj = self.pool.get('res.partner.bank.type')
|
||||
|
||||
type_ids = bank_type_obj.search(cursor, uid, [])
|
||||
bank_type_names = {}
|
||||
for bank_type in bank_type_obj.browse(cursor, uid, type_ids,
|
||||
context=context):
|
||||
bank_type_names[bank_type.code] = bank_type.name
|
||||
res = []
|
||||
for r in self.read(cursor, uid, ids, ['name','state'], context):
|
||||
res.append((r['id'], r['name']+' : '+bank_type_names.get(r['state'], '')))
|
||||
return res
|
||||
|
||||
def _prepare_name(self, bank):
|
||||
"Hook to get bank number of bank account"
|
||||
res = u''
|
||||
|
||||
@@ -60,6 +60,3 @@ IVC21det40,template_ivacode_pagata_21det40,IVA a credito 21% detraibile 40%,temp
|
||||
IVC21Idet40,template_impcode_pagata_21det40,IVA a credito 21% detraibile 40% (imponibile),template_impcode_pagata
|
||||
IVC21det50,template_ivacode_pagata_21det50,IVA a credito 21% detraibile 50%,template_ivacode_pagata
|
||||
IVC21Idet50,template_impcode_pagata_21det50,IVA a credito 21% detraibile 50% (imponibile),template_impcode_pagata
|
||||
Rit,template_ra,Ritenute d'acconto,vat_code_chart_root
|
||||
RitD20,template_ritcode_20,Ritenute a debito 20%,template_ra
|
||||
RitD20I,template_ritimpcode_20,Ritenute a debito 20% (imponibile),template_ra
|
||||
|
||||
|
@@ -62,4 +62,3 @@ id,description,chart_template_id:id,name,sequence,amount,parent_id:id,child_depe
|
||||
21I5,21I5,l10n_it_chart_template_generic,IVA al 21% detraibile al 50%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det50,,template_impcode_pagata_21det50,,,,False,-1,-1
|
||||
21I5b,21I5b,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (I),1,0.5,21I5,False,percent,,,purchase,,,,,,,False,,
|
||||
21I5a,21I5a,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (D),2,0,21I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det50,,template_ivacode_pagata_21det50,,,False,,
|
||||
rit-20,rit-20,l10n_it_chart_template_generic,Ritenuta d'acconto al 20% (debito),,-0.2,,False,percent,2602,2602,purchase,template_ritimpcode_20,template_ritcode_20,template_ritimpcode_20,template_ritcode_20,-1,1,False,1,-1
|
||||
|
||||
|
@@ -111,7 +111,7 @@ class report_custom(report_rml):
|
||||
<PageWidth>595.27</PageWidth>
|
||||
<PageHeight>841.88</PageHeight>
|
||||
<tableSize>55.00mm,58.00mm,29.00mm,29.00mm,29.00mm</tableSize>
|
||||
""" % (user_pool.browse(cr, uid, uid).company_id.name)
|
||||
""" % to_xml(user_pool.browse(cr, uid, uid).company_id.name)
|
||||
config_stop = """
|
||||
<report-footer>Generated by OpenERP</report-footer>
|
||||
</config>
|
||||
|
||||
@@ -690,7 +690,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||
'repair_id': fields.many2one('mrp.repair', 'Repair Order Reference',ondelete='cascade', select=True),
|
||||
'type': fields.selection([('add','Add'),('remove','Remove')],'Type', required=True),
|
||||
'to_invoice': fields.boolean('To Invoice'),
|
||||
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], required=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True),
|
||||
'invoiced': fields.boolean('Invoiced',readonly=True),
|
||||
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
|
||||
'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Account')),
|
||||
|
||||
@@ -34,7 +34,7 @@ class order(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(order, self).__init__(cr, uid, name, context=context)
|
||||
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
partner = user.company_id.partner_id
|
||||
|
||||
self.localcontext.update({
|
||||
|
||||
@@ -35,8 +35,8 @@ class share_wizard_portal(osv.TransientModel):
|
||||
|
||||
def _user_type_selection(self, cr, uid, context=None):
|
||||
selection = super(share_wizard_portal, self)._user_type_selection(cr, uid, context=context)
|
||||
selection.extend([('existing','Users you already shared with'),
|
||||
('groups','Existing Groups (e.g Portal Groups)')])
|
||||
selection.extend([('existing',_('Users you already shared with')),
|
||||
('groups',_('Existing Groups (e.g Portal Groups)'))])
|
||||
return selection
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -166,17 +166,17 @@ class project(osv.osv):
|
||||
res[id]['progress_rate'] = 0.0
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, *args, **kwargs):
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
alias_ids = []
|
||||
mail_alias = self.pool.get('mail.alias')
|
||||
for proj in self.browse(cr, uid, ids):
|
||||
for proj in self.browse(cr, uid, ids, context=context):
|
||||
if proj.tasks:
|
||||
raise osv.except_osv(_('Invalid Action!'),
|
||||
_('You cannot delete a project containing tasks. You can either delete all the project\'s tasks and then delete the project or simply deactivate the project.'))
|
||||
elif proj.alias_id:
|
||||
alias_ids.append(proj.alias_id.id)
|
||||
res = super(project, self).unlink(cr, uid, ids, *args, **kwargs)
|
||||
mail_alias.unlink(cr, uid, alias_ids, *args, **kwargs)
|
||||
res = super(project, self).unlink(cr, uid, ids, context=context)
|
||||
mail_alias.unlink(cr, uid, alias_ids, context=context)
|
||||
return res
|
||||
|
||||
def _get_attached_docs(self, cr, uid, ids, field_name, arg, context):
|
||||
|
||||
@@ -46,7 +46,7 @@ class purchase_order(osv.osv):
|
||||
cur = order.pricelist_id.currency_id
|
||||
for line in order.order_line:
|
||||
val1 += line.price_subtotal
|
||||
for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id.id, order.partner_id)['taxes']:
|
||||
for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id, order.partner_id)['taxes']:
|
||||
val += c.get('amount', 0.0)
|
||||
res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val)
|
||||
res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1)
|
||||
@@ -823,7 +823,7 @@ class purchase_order_line(osv.osv):
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty)
|
||||
taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id, line.order_id.partner_id)
|
||||
cur = line.order_id.pricelist_id.currency_id
|
||||
res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
|
||||
return res
|
||||
|
||||
+2
-2
@@ -903,7 +903,7 @@ class sale_order_line(osv.osv):
|
||||
|
||||
result = {}
|
||||
warning_msgs = {}
|
||||
product_obj = product_obj.browse(cr, uid, product, context=context)
|
||||
product_obj = product_obj.browse(cr, uid, product, context=context_partner)
|
||||
|
||||
uom2 = False
|
||||
if uom:
|
||||
@@ -922,7 +922,7 @@ class sale_order_line(osv.osv):
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
|
||||
|
||||
if not flag:
|
||||
result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
|
||||
result['name'] = product_obj.name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
|
||||
if product_obj.description_sale:
|
||||
result['name'] += '\n'+product_obj.description_sale
|
||||
domain = {}
|
||||
|
||||
@@ -74,7 +74,7 @@ class share_wizard(osv.TransientModel):
|
||||
|
||||
def _user_type_selection(self, cr, uid, context=None):
|
||||
"""Selection values may be easily overridden/extended via inheritance"""
|
||||
return [('embedded', 'Direct link or embed code'), ('emails','Emails'), ]
|
||||
return [('embedded', _('Direct link or embed code')), ('emails',_('Emails')), ]
|
||||
|
||||
"""Override of create() to auto-compute the action name"""
|
||||
def create(self, cr, uid, values, context=None):
|
||||
|
||||
@@ -1351,14 +1351,14 @@ class stock_picking(osv.osv):
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
# Then we finish the good picking
|
||||
self.write(cr, uid, [pick.id], {'backorder_id': new_picking})
|
||||
self.action_move(cr, uid, [new_picking])
|
||||
self.action_move(cr, uid, [new_picking], context=context)
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr)
|
||||
wf_service.trg_write(uid, 'stock.picking', pick.id, cr)
|
||||
delivered_pack_id = new_picking
|
||||
back_order_name = self.browse(cr, uid, delivered_pack_id, context=context).name
|
||||
self.back_order_send_note(cr, uid, ids, back_order_name, context)
|
||||
else:
|
||||
self.action_move(cr, uid, [pick.id])
|
||||
self.action_move(cr, uid, [pick.id], context=context)
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
|
||||
delivered_pack_id = pick.id
|
||||
self.ship_done_send_note(cr, uid, ids, context)
|
||||
@@ -2123,7 +2123,7 @@ class stock_move(osv.osv):
|
||||
old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
|
||||
if old_ptype != picking.type:
|
||||
old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
|
||||
self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name}, context=context)
|
||||
self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
|
||||
else:
|
||||
pickid = False
|
||||
for move, (loc, dummy, delay, dummy, company_id, ptype) in todo:
|
||||
|
||||
@@ -79,8 +79,6 @@ class stock_fill_inventory(osv.osv_memory):
|
||||
|
||||
inventory_line_obj = self.pool.get('stock.inventory.line')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
product_obj = self.pool.get('product.product')
|
||||
stock_location_obj = self.pool.get('stock.location')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
if ids and len(ids):
|
||||
|
||||
Reference in New Issue
Block a user