[MERGE] from trunk
bzr revid: chm@openerp.com-20130215084451-yojtl45cqw479wp5
This commit is contained in:
@@ -39,6 +39,8 @@ class account_financial_report(osv.osv):
|
||||
_description = "Account Report"
|
||||
|
||||
def _get_level(self, cr, uid, ids, field_name, arg, context=None):
|
||||
'''Returns a dictionary with key=the ID of a record and value = the level of this
|
||||
record in the tree structure.'''
|
||||
res = {}
|
||||
for report in self.browse(cr, uid, ids, context=context):
|
||||
level = 0
|
||||
@@ -48,6 +50,8 @@ class account_financial_report(osv.osv):
|
||||
return res
|
||||
|
||||
def _get_children_by_order(self, cr, uid, ids, context=None):
|
||||
'''returns a dictionary with the key= the ID of a record and value = all its children,
|
||||
computed recursively, and sorted by sequence. Ready for the printing'''
|
||||
res = []
|
||||
for id in ids:
|
||||
res.append(id)
|
||||
@@ -56,6 +60,12 @@ class account_financial_report(osv.osv):
|
||||
return res
|
||||
|
||||
def _get_balance(self, cr, uid, ids, field_names, args, context=None):
|
||||
'''returns a dictionary with key=the ID of a record and value=the balance amount
|
||||
computed for this record. If the record is of type :
|
||||
'accounts' : it's the sum of the linked accounts
|
||||
'account_type' : it's the sum of leaf accoutns with such an account_type
|
||||
'account_report' : it's the amount of the related report
|
||||
'sum' : it's the sum of the children of this record (aka a 'view' record)'''
|
||||
account_obj = self.pool.get('account.account')
|
||||
res = {}
|
||||
for report in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
@@ -23,7 +23,6 @@ import time
|
||||
from lxml import etree
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp import pooler
|
||||
from openerp.osv import fields, osv, orm
|
||||
from openerp.tools.translate import _
|
||||
@@ -80,11 +79,10 @@ class account_invoice(osv.osv):
|
||||
|
||||
def _reconciled(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for inv in self.browse(cr, uid, ids, context=context):
|
||||
res[inv.id] = self.test_paid(cr, uid, [inv.id])
|
||||
if not res[inv.id] and inv.state == 'paid':
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'open_test', cr)
|
||||
self.signal_open_test(cr, uid, [inv.id])
|
||||
return res
|
||||
|
||||
def _get_reference_type(self, cr, uid, context=None):
|
||||
@@ -638,10 +636,8 @@ class account_invoice(osv.osv):
|
||||
# go from canceled state to draft state
|
||||
def action_cancel_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for inv_id in ids:
|
||||
wf_service.trg_delete(uid, 'account.invoice', inv_id, cr)
|
||||
wf_service.trg_create(uid, 'account.invoice', inv_id, cr)
|
||||
self.delete_workflow(cr, uid, ids)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
return True
|
||||
|
||||
# Workflow stuff
|
||||
@@ -1394,7 +1390,12 @@ class account_invoice_line(osv.osv):
|
||||
# XXX this gets the default account for the user's company,
|
||||
# it should get the default account for the invoice's company
|
||||
# however, the invoice's company does not reach this point
|
||||
prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('type') in ('out_invoice','out_refund'):
|
||||
prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
|
||||
else:
|
||||
prop = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category', context=context)
|
||||
return prop and prop.id or False
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -151,12 +151,12 @@ class account_config_settings(osv.osv_memory):
|
||||
self.write(cr, uid, [id], vals, context)
|
||||
return id
|
||||
|
||||
def onchange_company_id(self, cr, uid, ids, company_id):
|
||||
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
|
||||
# update related fields
|
||||
values = {}
|
||||
values['currency_id'] = False
|
||||
if company_id:
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id)
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
|
||||
has_chart_of_accounts = company_id not in self.pool.get('account.installer').get_unconfigured_cmp(cr, uid)
|
||||
fiscalyear_count = self.pool.get('account.fiscalyear').search_count(cr, uid,
|
||||
[('date_start', '<=', time.strftime('%Y-%m-%d')), ('date_stop', '>=', time.strftime('%Y-%m-%d')),
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<label for="company_id" string="Select Company"/>
|
||||
<field name="company_id"
|
||||
widget="selection"
|
||||
on_change="onchange_company_id(company_id)"
|
||||
on_change="onchange_company_id(company_id, context)"
|
||||
class="oe_inline"/>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -23,7 +23,6 @@ import time
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
|
||||
class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
@@ -90,7 +89,6 @@ class account_invoice_refund(osv.osv_memory):
|
||||
account_m_line_obj = self.pool.get('account.move.line')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
inv_tax_obj = self.pool.get('account.invoice.tax')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
@@ -161,8 +159,7 @@ class account_invoice_refund(osv.osv_memory):
|
||||
to_reconcile_ids[line.account_id.id] = [line.id]
|
||||
if type(line.reconcile_id) != osv.orm.browse_null:
|
||||
reconcile_obj.unlink(cr, uid, line.reconcile_id.id)
|
||||
wf_service.trg_validate(uid, 'account.invoice', \
|
||||
refund.id, 'invoice_open', cr)
|
||||
inv_obj.signal_invoice_open(cr, uid, [refund.id])
|
||||
refund = inv_obj.browse(cr, uid, refund_id[0], context=context)
|
||||
for tmpline in refund.move_id.line_id:
|
||||
if tmpline.account_id.id == inv.account_id.id:
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
from openerp import pooler
|
||||
|
||||
class account_invoice_confirm(osv.osv_memory):
|
||||
@@ -33,16 +32,16 @@ class account_invoice_confirm(osv.osv_memory):
|
||||
_description = "Confirm the selected invoices"
|
||||
|
||||
def invoice_confirm(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
if context is None:
|
||||
context = {}
|
||||
pool_obj = pooler.get_pool(cr.dbname)
|
||||
data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
|
||||
account_invoice_obj = pool_obj.get('account.invoice')
|
||||
data_inv = account_invoice_obj.read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
for record in data_inv:
|
||||
if record['state'] not in ('draft','proforma','proforma2'):
|
||||
raise osv.except_osv(_('Warning!'), _("Selected invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state."))
|
||||
wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_open', cr)
|
||||
account_invoice_obj.signal_invoice_open(cr, uid, [ record['id'] ])
|
||||
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
account_invoice_confirm()
|
||||
@@ -59,14 +58,13 @@ class account_invoice_cancel(osv.osv_memory):
|
||||
def invoice_cancel(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
pool_obj = pooler.get_pool(cr.dbname)
|
||||
data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
|
||||
account_invoice_obj = pool_obj.get('account.invoice')
|
||||
data_inv = account_invoice_obj.read(cr, uid, context['active_ids'], ['state'], context=context)
|
||||
for record in data_inv:
|
||||
if record['state'] in ('cancel','paid'):
|
||||
raise osv.except_osv(_('Warning!'), _("Selected invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state."))
|
||||
wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_cancel', cr)
|
||||
account_invoice_obj.signal_invoice_cancel(cr , uid, [record['id']])
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
account_invoice_cancel()
|
||||
|
||||
@@ -35,8 +35,7 @@ class account_state_open(osv.osv_memory):
|
||||
data_inv = obj_invoice.browse(cr, uid, context['active_ids'][0], context=context)
|
||||
if data_inv.reconciled:
|
||||
raise osv.except_osv(_('Warning!'), _('Invoice is already reconciled.'))
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr)
|
||||
obj_invoice.signal_open_test(cr, uid, context['active_ids'][0])
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
account_state_open()
|
||||
|
||||
@@ -331,6 +331,9 @@ class account_asset_asset(osv.osv):
|
||||
depreciation_obj = self.pool.get('account.asset.depreciation.line')
|
||||
period = period_obj.browse(cr, uid, period_id, context=context)
|
||||
depreciation_ids = depreciation_obj.search(cr, uid, [('asset_id', 'in', ids), ('depreciation_date', '<=', period.date_stop), ('depreciation_date', '>=', period.date_start), ('move_check', '=', False)], context=context)
|
||||
if context is None:
|
||||
context = {}
|
||||
context.update({'depreciation_date':period.date_stop})
|
||||
return depreciation_obj.create_move(cr, uid, depreciation_ids, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
@@ -388,7 +391,7 @@ class account_asset_depreciation_line(osv.osv):
|
||||
created_move_ids = []
|
||||
asset_ids = []
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
depreciation_date = time.strftime('%Y-%m-%d')
|
||||
depreciation_date = context.get('depreciation_date') or time.strftime('%Y-%m-%d')
|
||||
period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
|
||||
company_currency = line.asset_id.company_id.currency_id.id
|
||||
current_currency = line.asset_id.currency_id.id
|
||||
|
||||
@@ -238,7 +238,12 @@ class res_partner(osv.osv):
|
||||
from report import account_followup_print
|
||||
|
||||
assert len(ids) == 1
|
||||
if context is None:
|
||||
context = {}
|
||||
partner = self.browse(cr, uid, ids[0], context=context)
|
||||
#copy the context to not change global context. Overwrite it because _() looks for the lang in local variable 'context'.
|
||||
#Set the language to use = the partner language
|
||||
context = dict(context, lang=partner.lang)
|
||||
followup_table = ''
|
||||
if partner.unreconciled_aml_ids:
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
|
||||
@@ -251,13 +256,14 @@ class res_partner(osv.osv):
|
||||
followup_table += '''
|
||||
<table border="2" width=100%%>
|
||||
<tr>
|
||||
<td>Invoice date</td>
|
||||
<td>Reference</td>
|
||||
<td>Due date</td>
|
||||
<td>Amount (%s)</td>
|
||||
<td>Lit.</td>
|
||||
<td>''' + _("Invoice Date") + '''</td>
|
||||
<td>''' + _("Description") + '''</td>
|
||||
<td>''' + _("Reference") + '''</td>
|
||||
<td>''' + _("Due Date") + '''</td>
|
||||
<td>''' + _("Amount") + " (%s)" % (currency.symbol) + '''</td>
|
||||
<td>''' + _("Lit.") + '''</td>
|
||||
</tr>
|
||||
''' % (currency.symbol)
|
||||
'''
|
||||
total = 0
|
||||
for aml in currency_dict['line']:
|
||||
block = aml['blocked'] and 'X' or ' '
|
||||
@@ -268,13 +274,28 @@ class res_partner(osv.osv):
|
||||
if date <= current_date and aml['balance'] > 0:
|
||||
strbegin = "<TD><B>"
|
||||
strend = "</B></TD>"
|
||||
followup_table +="<TR>" + strbegin + str(aml['date']) + strend + strbegin + aml['ref'] + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "</TR>"
|
||||
followup_table +="<TR>" + strbegin + str(aml['date']) + strend + strbegin + aml['name'] + strend + strbegin + aml['ref'] + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "</TR>"
|
||||
total = rml_parse.formatLang(total, dp='Account', currency_obj=currency)
|
||||
followup_table += '''<tr> </tr>
|
||||
</table>
|
||||
<center>Amount due: %s </center>''' % (total)
|
||||
<center>''' + _("Amount due") + ''' : %s </center>''' % (total)
|
||||
return followup_table
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.get("payment_responsible_id", False):
|
||||
for part in self.browse(cr, uid, ids, context=context):
|
||||
if part.payment_responsible_id <> vals["payment_responsible_id"]:
|
||||
#Find partner_id of user put as responsible
|
||||
responsible_partner_id = self.pool.get("res.users").browse(cr, uid, vals['payment_responsible_id'], context=context).partner_id.id
|
||||
self.pool.get("mail.thread").message_post(cr, uid, 0,
|
||||
body = _("You became responsible to do the next action for the payment follow-up of") + " <b><a href='#id=" + str(part.id) + "&view_type=form&model=res.partner'> " + part.name + " </a></b>",
|
||||
type = 'comment',
|
||||
subtype = "mail.mt_comment", context = context,
|
||||
model = 'res.partner', res_id = part.id,
|
||||
notified_partner_ids = [(6, 0, [responsible_partner_id])],
|
||||
partner_ids = [(6, 0, [responsible_partner_id])])
|
||||
return super(res_partner, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def action_done(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'payment_next_action_date': False, 'payment_next_action':'', 'payment_responsible_id': False}, context=context)
|
||||
|
||||
@@ -408,13 +429,16 @@ class res_partner(osv.osv):
|
||||
_inherit = "res.partner"
|
||||
_columns = {
|
||||
'payment_responsible_id':fields.many2one('res.users', ondelete='set null', string='Follow-up Responsible',
|
||||
help="Optionally you can assign a user to this field, which will make him responsible for the action."),
|
||||
'payment_note':fields.text('Customer Payment Promise', help="Payment Note"),
|
||||
help="Optionally you can assign a user to this field, which will make him responsible for the action.",
|
||||
track_visibility="onchange"),
|
||||
'payment_note':fields.text('Customer Payment Promise', help="Payment Note", track_visibility="onchange"),
|
||||
'payment_next_action':fields.text('Next Action',
|
||||
help="This is the next action to be taken. It will automatically be set when the partner gets a follow-up level that requires a manual action. "),
|
||||
help="This is the next action to be taken. It will automatically be set when the partner gets a follow-up level that requires a manual action. ",
|
||||
track_visibility="onchange"),
|
||||
'payment_next_action_date':fields.date('Next Action Date',
|
||||
help="This is when the manual follow-up is needed. " \
|
||||
"The date will be set to the current date when the partner gets a follow-up level that requires a manual action. Can be practical to set manually e.g. to see if he keeps his promises."),
|
||||
"The date will be set to the current date when the partner gets a follow-up level that requires a manual action. "\
|
||||
"Can be practical to set manually e.g. to see if he keeps his promises."),
|
||||
'unreconciled_aml_ids':fields.one2many('account.move.line', 'partner_id', domain=['&', ('reconcile_id', '=', False), '&',
|
||||
('account_id.active','=', True), '&', ('account_id.type', '=', 'receivable'), ('state', '!=', 'draft')]),
|
||||
'latest_followup_date':fields.function(_get_latest, method=True, type='date', string="Latest Follow-up Date",
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
<filter string="Follow-ups To Do" domain="[('payment_next_action_date', '<=', time.strftime('%%Y-%%m-%%d')), ('payment_amount_overdue', '>', 0.0)]" name="todo"/>
|
||||
<separator/>
|
||||
<filter string="No Responsible" domain="[('payment_responsible_id', '=', False)]"/>
|
||||
<filter string="My Follow-ups" domain="[('payment_responsible_id','=', uid)]"/>
|
||||
<filter string="My Follow-ups" domain="[('payment_responsible_id','=', uid)]" name="my"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Responsible" context="{'group_by':'payment_responsible_id'}"/>
|
||||
<filter string="Follow-up Responsible" context="{'group_by':'payment_responsible_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -132,6 +132,18 @@
|
||||
<!-- Menus about followup of customers -->
|
||||
<menuitem id="account_followup_s" action="action_customer_followup"
|
||||
parent="menu_finance_followup" name="Do Manual Follow-Ups" sequence="3"/>
|
||||
|
||||
<record id="action_customer_my_followup" model="ir.actions.act_window">
|
||||
<field name="name">My Follow-Ups</field>
|
||||
<field name="view_id" ref="customer_followup_tree"/>
|
||||
<field name="res_model">res.partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('payment_amount_due', '>', 0.0)]</field>
|
||||
<field name="context">{'Followupfirst':True, 'search_default_todo': True, 'search_default_my': True} </field>
|
||||
<field name="search_view_id" ref="customer_followup_search_view"/>
|
||||
</record>
|
||||
<menuitem id="base.menu_sales_followup" parent="base.menu_base_partner" name="Payment Follow-up" groups="account.group_account_invoice" sequence="2"/>
|
||||
<menuitem id="menu_sale_followup" parent="base.menu_sales_followup" sequence="10"
|
||||
action="action_customer_my_followup" groups="account.group_account_invoice"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -44,8 +44,7 @@ class TestAccountFollowup(TransactionCase):
|
||||
'quantity': 5,
|
||||
'price_unit':200
|
||||
})]})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.invoice', self.invoice_id, 'invoice_open', cr)
|
||||
self.registry('account.invoice').signal_invoice_open(cr, uid, [self.invoice_id])
|
||||
|
||||
self.voucher = self.registry("account.voucher")
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ from openerp import tools
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
class account_followup_stat_by_partner(osv.osv):
|
||||
_name = "account_followup.stat.by.partner"
|
||||
_description = "Follow-up Statistics by Partner"
|
||||
@@ -127,7 +129,7 @@ class account_followup_print(osv.osv_memory):
|
||||
'email_body': fields.text('Email Body'),
|
||||
'summary': fields.text('Summary', readonly=True),
|
||||
'test_print': fields.boolean('Test Print',
|
||||
help='Check if you want to print follow-ups without changing follow-ups level.'),
|
||||
help='Check if you want to print follow-ups without changing follow-up level.'),
|
||||
}
|
||||
|
||||
def _get_followup(self, cr, uid, context=None):
|
||||
@@ -204,7 +206,7 @@ class account_followup_print(osv.osv_memory):
|
||||
if not part.unreconciled_aml_ids:
|
||||
partners_to_clear.append(part.id)
|
||||
self.pool.get('res.partner').action_done(cr, uid, partners_to_clear, context=context)
|
||||
return len(ids)
|
||||
return len(partners_to_clear)
|
||||
|
||||
def do_process(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
@@ -313,6 +315,13 @@ class account_followup_print(osv.osv_memory):
|
||||
if stat_line_id not in partner_list:
|
||||
partner_list.append(stat_line_id)
|
||||
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': stat_line_id}
|
||||
#Remove partners that are other companies in OpenERP
|
||||
comp_obj = self.pool.get("res.company")
|
||||
comp_ids = comp_obj.search(cr, SUPERUSER_ID, [], context=context)
|
||||
for comp in comp_obj.browse(cr, SUPERUSER_ID, comp_ids, context=context):
|
||||
company_partner_wiz_id = comp.partner_id.id * 10000 + company_id
|
||||
if company_partner_wiz_id in partner_list:
|
||||
partner_list.remove(company_partner_wiz_id)
|
||||
return {'partner_ids': partner_list, 'to_update': to_update}
|
||||
|
||||
account_followup_print()
|
||||
|
||||
@@ -23,7 +23,6 @@ import logging
|
||||
import time
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -120,9 +119,7 @@ class payment_order(osv.osv):
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state': 'draft'})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_create(uid, 'payment.order', id, cr)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_open(self, cr, uid, ids, *args):
|
||||
@@ -135,9 +132,8 @@ class payment_order(osv.osv):
|
||||
return True
|
||||
|
||||
def set_done(self, cr, uid, ids, *args):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self.write(cr, uid, ids, {'date_done': time.strftime('%Y-%m-%d')})
|
||||
wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr)
|
||||
self.signal_done(cr, uid, [ids[0]])
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
# Turkish translation for openobject-addons
|
||||
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2013-02-11 08:26+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Turkish <tr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-12 04:43+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid ""
|
||||
"Code should always set a variable named `result` with the result of your "
|
||||
"test, that can be a list or\n"
|
||||
"a dictionary. If `result` is an empty list, it means that the test was "
|
||||
"succesful. Otherwise it will\n"
|
||||
"try to translate and print what is inside `result`.\n"
|
||||
"\n"
|
||||
"If the result of your test is a dictionary, you can set a variable named "
|
||||
"`column_order` to choose in\n"
|
||||
"what order you want to print `result`'s content.\n"
|
||||
"\n"
|
||||
"Should you need them, you can also use the following variables into your "
|
||||
"code:\n"
|
||||
" * cr: cursor to the database\n"
|
||||
" * uid: ID of the current user\n"
|
||||
"\n"
|
||||
"In any ways, the code must be legal python statements with correct "
|
||||
"indentation (if needed).\n"
|
||||
"\n"
|
||||
"Example: \n"
|
||||
" sql = '''SELECT id, name, ref, date\n"
|
||||
" FROM account_move_line \n"
|
||||
" WHERE account_id IN (SELECT id FROM account_account WHERE type "
|
||||
"= 'view')\n"
|
||||
" '''\n"
|
||||
" cr.execute(sql)\n"
|
||||
" result = cr.dictfetchall()"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_02
|
||||
msgid "Test 2: Opening a fiscal year"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_05
|
||||
msgid ""
|
||||
"Check that reconciled invoice for Sales/Purchases has reconciled entries for "
|
||||
"Payable and Receivable Accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_03
|
||||
msgid ""
|
||||
"Check if movement lines are balanced and have the same date and period"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: field:accounting.assert.test,name:0
|
||||
msgid "Test Name"
|
||||
msgstr "Test Adı"
|
||||
|
||||
#. module: account_test
|
||||
#: report:account.test.assert.print:0
|
||||
msgid "Accouting tests on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_01
|
||||
msgid "Test 1: General balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_06
|
||||
msgid "Check that paid/reconciled invoices are not in 'Open' state"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_05_2
|
||||
msgid ""
|
||||
"Check that reconciled account moves, that define Payable and Receivable "
|
||||
"accounts, are belonging to reconciled invoices"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid "Tests"
|
||||
msgstr "Testler"
|
||||
|
||||
#. module: account_test
|
||||
#: field:accounting.assert.test,desc:0
|
||||
msgid "Test Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_06_1
|
||||
msgid "Check that there's no move for any account with « View » account type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_08
|
||||
msgid "Test 9 : Accounts and partners on account moves"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:ir.actions.act_window,name:account_test.action_accounting_assert
|
||||
#: model:ir.actions.report.xml,name:account_test.account_assert_test_report
|
||||
#: model:ir.ui.menu,name:account_test.menu_action_license
|
||||
msgid "Accounting Tests"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: code:addons/account_test/report/account_test_report.py:74
|
||||
#, python-format
|
||||
msgid "The test was passed successfully"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: field:accounting.assert.test,active:0
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_06
|
||||
msgid "Test 6 : Invoices status"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:ir.model,name:account_test.model_accounting_assert_test
|
||||
msgid "accounting.assert.test"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_05
|
||||
msgid ""
|
||||
"Test 5.1 : Payable and Receivable accountant lines of reconciled invoices"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: field:accounting.assert.test,code_exec:0
|
||||
msgid "Python code"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_07
|
||||
msgid ""
|
||||
"Check on bank statement that the Closing Balance = Starting Balance + sum of "
|
||||
"statement lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_07
|
||||
msgid "Test 8 : Closing balance on bank statements"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_03
|
||||
msgid "Test 3: Movement lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_05_2
|
||||
msgid "Test 5.2 : Reconcilied invoices and Payable/Receivable accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid "Expression"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_04
|
||||
msgid "Test 4: Totally reconciled mouvements"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_04
|
||||
msgid "Check if the totally reconciled movements are balanced"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: field:accounting.assert.test,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_02
|
||||
msgid ""
|
||||
"Check if the balance of the new opened fiscal year matches with last year's "
|
||||
"balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid "Python Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:ir.actions.act_window,help:account_test.action_accounting_assert
|
||||
msgid ""
|
||||
"<p class=\"oe_view_nocontent_create\">\n"
|
||||
" Click to create Accounting Test.\n"
|
||||
" </p>\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_01
|
||||
msgid "Check the balance: Debit sum = Credit sum"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,desc:account_test.account_test_08
|
||||
msgid "Check that general accounts and partners on account moves are active"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: model:accounting.assert.test,name:account_test.account_test_06_1
|
||||
msgid "Test 7: « View » account type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_test
|
||||
#: view:accounting.assert.test:0
|
||||
msgid "Code Help"
|
||||
msgstr ""
|
||||
@@ -22,7 +22,6 @@
|
||||
import time
|
||||
from lxml import etree
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import fields, osv
|
||||
import openerp.addons.decimal_precision as dp
|
||||
from openerp.tools.translate import _
|
||||
@@ -50,13 +49,25 @@ class account_config_settings(osv.osv_memory):
|
||||
'company_id', 'income_currency_exchange_account_id',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Gain Exchange Rate Account"),
|
||||
string="Gain Exchange Rate Account",
|
||||
domain="[('type', '=', 'other')]"),
|
||||
'expense_currency_exchange_account_id': fields.related(
|
||||
'company_id', 'expense_currency_exchange_account_id',
|
||||
type="many2one",
|
||||
relation='account.account',
|
||||
string="Loss Exchange Rate Account"),
|
||||
string="Loss Exchange Rate Account",
|
||||
domain="[('type', '=', 'other')]"),
|
||||
}
|
||||
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
|
||||
res = super(account_config_settings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
|
||||
if company_id:
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
|
||||
res['value'].update({'income_currency_exchange_account_id': company.income_currency_exchange_account_id and company.income_currency_exchange_account_id.id or False,
|
||||
'expense_currency_exchange_account_id': company.expense_currency_exchange_account_id and company.expense_currency_exchange_account_id.id or False})
|
||||
else:
|
||||
res['value'].update({'income_currency_exchange_account_id': False,
|
||||
'expense_currency_exchange_account_id': False})
|
||||
return res
|
||||
|
||||
class account_voucher(osv.osv):
|
||||
def _check_paid(self, cr, uid, ids, name, args, context=None):
|
||||
@@ -820,10 +831,7 @@ class account_voucher(osv.osv):
|
||||
return vals
|
||||
|
||||
def button_proforma_voucher(self, cr, uid, ids, context=None):
|
||||
context = context or {}
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for vid in ids:
|
||||
wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, ids)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
def proforma_voucher(self, cr, uid, ids, context=None):
|
||||
@@ -831,9 +839,7 @@ class account_voucher(osv.osv):
|
||||
return True
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for voucher_id in ids:
|
||||
wf_service.trg_create(uid, 'account.voucher', voucher_id, cr)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
@@ -1508,7 +1514,6 @@ class account_bank_statement(osv.osv):
|
||||
|
||||
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None):
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
move_line_obj = self.pool.get('account.move.line')
|
||||
bank_st_line_obj = self.pool.get('account.bank.statement.line')
|
||||
st_line = bank_st_line_obj.browse(cr, uid, st_line_id, context=context)
|
||||
@@ -1516,7 +1521,7 @@ class account_bank_statement(osv.osv):
|
||||
voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context)
|
||||
if st_line.voucher_id.state == 'cancel':
|
||||
voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context)
|
||||
wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr)
|
||||
voucher_obj.signal_proforma_voucher(cr, uid, [st_line.voucher_id.id])
|
||||
|
||||
v = voucher_obj.browse(cr, uid, st_line.voucher_id.id, context=context)
|
||||
bank_st_line_obj.write(cr, uid, [st_line_id], {
|
||||
|
||||
@@ -159,8 +159,6 @@
|
||||
I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$>
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_1_case1'))
|
||||
data = []
|
||||
@@ -183,10 +181,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my first voucher is valid
|
||||
-
|
||||
@@ -257,8 +253,6 @@
|
||||
I fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_2_case1'))
|
||||
data = []
|
||||
@@ -281,10 +275,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my second voucher is valid
|
||||
-
|
||||
|
||||
@@ -131,8 +131,6 @@
|
||||
I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_1_case2_suppl'))
|
||||
data = []
|
||||
@@ -162,10 +160,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my voucher is valid
|
||||
-
|
||||
@@ -237,8 +233,6 @@
|
||||
I fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$>
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2_suppl'))
|
||||
data = []
|
||||
@@ -268,10 +262,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that my voucher state is posted
|
||||
-
|
||||
|
||||
@@ -182,8 +182,7 @@
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my voucher is valid
|
||||
-
|
||||
@@ -258,8 +257,7 @@
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that my voucher state is posted
|
||||
-
|
||||
|
||||
@@ -163,8 +163,6 @@
|
||||
I fill amounts 130 for the invoice of 200$ and 70 for the invoice of 100$>
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_1_case2b'))
|
||||
data = []
|
||||
@@ -180,10 +178,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my voucher is valid
|
||||
-
|
||||
@@ -247,8 +243,6 @@
|
||||
and I fully reconcil the 2 previous invoices
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2b'))
|
||||
data = []
|
||||
@@ -271,10 +265,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that my voucher state is posted
|
||||
-
|
||||
|
||||
@@ -118,8 +118,6 @@
|
||||
I fill amounts 100 for the invoice of 150€ and 20 for the invoice of 80€
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_1_case3'))
|
||||
data = []
|
||||
@@ -142,10 +140,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my first voucher is valid
|
||||
-
|
||||
@@ -209,8 +205,6 @@
|
||||
I fill amounts 50 for the invoice of 150€ and 70 for the invoice of 80€
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import time
|
||||
from openerp import netsvc
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_2_case3'))
|
||||
data = []
|
||||
@@ -233,10 +227,8 @@
|
||||
I confirm the voucher
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my second voucher is valid
|
||||
-
|
||||
|
||||
@@ -144,8 +144,7 @@
|
||||
!python {model: account.voucher}: |
|
||||
from openerp import netsvc
|
||||
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, voucher)
|
||||
-
|
||||
I check that the move of my voucher is valid
|
||||
-
|
||||
|
||||
@@ -61,8 +61,7 @@
|
||||
id = self.create(cr, uid, vals)
|
||||
voucher_id = self.browse(cr, uid, id)
|
||||
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, [voucher_id.id])
|
||||
|
||||
-
|
||||
Finally i will Confirm the state of the invoice is paid
|
||||
|
||||
@@ -65,8 +65,7 @@
|
||||
id = self.create(cr, uid, vals)
|
||||
voucher_id = self.browse(cr, uid, id)
|
||||
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
|
||||
self.signal_proforma_voucher(cr, uid, [voucher_id.id])
|
||||
-
|
||||
I check that move lines are reconciled meaning voucher is paid
|
||||
-
|
||||
|
||||
@@ -307,8 +307,9 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
|
||||
<field name="period_id"/>
|
||||
<field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
|
||||
<field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="name" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
||||
<field name="account_id"
|
||||
|
||||
+326
-321
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.osv.osv import object_proxy
|
||||
import openerp.service.model
|
||||
from openerp.tools.translate import _
|
||||
from openerp import pooler
|
||||
import time
|
||||
@@ -171,355 +171,360 @@ class audittrail_log_line(osv.osv):
|
||||
'field_description': fields.char('Field Description', size=64),
|
||||
}
|
||||
|
||||
class audittrail_objects_proxy(object_proxy):
|
||||
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
|
||||
# Monkeypatch the model RPC endpoint for auditing changes.
|
||||
|
||||
def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
|
||||
"""
|
||||
Gets textual values for the fields.
|
||||
If the field is a many2one, it returns the name.
|
||||
If it's a one2many or a many2many, it returns a list of name.
|
||||
In other cases, it just returns the value.
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID for security checks,
|
||||
:param pool: current db's pooler object.
|
||||
:param resource_pool: pooler object of the model which values are being changed.
|
||||
:param field: for which the text value is to be returned.
|
||||
:param value: value of the field.
|
||||
:param recursive: True or False, True will repeat the process recursively
|
||||
:return: string value or a list of values(for O2M/M2M)
|
||||
"""
|
||||
def get_value_text(cr, uid, pool, resource_pool, method, field, value):
|
||||
"""
|
||||
Gets textual values for the fields.
|
||||
If the field is a many2one, it returns the name.
|
||||
If it's a one2many or a many2many, it returns a list of name.
|
||||
In other cases, it just returns the value.
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID for security checks,
|
||||
:param pool: current db's pooler object.
|
||||
:param resource_pool: pooler object of the model which values are being changed.
|
||||
:param field: for which the text value is to be returned.
|
||||
:param value: value of the field.
|
||||
:param recursive: True or False, True will repeat the process recursively
|
||||
:return: string value or a list of values(for O2M/M2M)
|
||||
"""
|
||||
|
||||
field_obj = (resource_pool._all_columns.get(field)).column
|
||||
if field_obj._type in ('one2many','many2many'):
|
||||
data = pool.get(field_obj._obj).name_get(cr, uid, value)
|
||||
#return the modifications on x2many fields as a list of names
|
||||
res = map(lambda x:x[1], data)
|
||||
elif field_obj._type == 'many2one':
|
||||
#return the modifications on a many2one field as its value returned by name_get()
|
||||
res = value and value[1] or value
|
||||
else:
|
||||
res = value
|
||||
return res
|
||||
field_obj = (resource_pool._all_columns.get(field)).column
|
||||
if field_obj._type in ('one2many','many2many'):
|
||||
data = pool.get(field_obj._obj).name_get(cr, uid, value)
|
||||
#return the modifications on x2many fields as a list of names
|
||||
res = map(lambda x:x[1], data)
|
||||
elif field_obj._type == 'many2one':
|
||||
#return the modifications on a many2one field as its value returned by name_get()
|
||||
res = value and value[1] or value
|
||||
else:
|
||||
res = value
|
||||
return res
|
||||
|
||||
def create_log_line(self, cr, uid, log_id, model, lines=None):
|
||||
"""
|
||||
Creates lines for changed fields with its old and new values
|
||||
def create_log_line(cr, uid, log_id, model, lines=None):
|
||||
"""
|
||||
Creates lines for changed fields with its old and new values
|
||||
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param model: Object which values are being changed
|
||||
@param lines: List of values for line is to be created
|
||||
"""
|
||||
if lines is None:
|
||||
lines = []
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
obj_pool = pool.get(model.model)
|
||||
model_pool = pool.get('ir.model')
|
||||
field_pool = pool.get('ir.model.fields')
|
||||
log_line_pool = pool.get('audittrail.log.line')
|
||||
for line in lines:
|
||||
field_obj = obj_pool._all_columns.get(line['name'])
|
||||
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
|
||||
field_obj = field_obj.column
|
||||
old_value = line.get('old_value', '')
|
||||
new_value = line.get('new_value', '')
|
||||
search_models = [model.id]
|
||||
if obj_pool._inherits:
|
||||
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
|
||||
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
|
||||
if field_obj._type == 'many2one':
|
||||
old_value = old_value and old_value[0] or old_value
|
||||
new_value = new_value and new_value[0] or new_value
|
||||
vals = {
|
||||
"log_id": log_id,
|
||||
"field_id": field_id and field_id[0] or False,
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": line.get('old_value_text', ''),
|
||||
"new_value_text": line.get('new_value_text', ''),
|
||||
"field_description": field_obj.string
|
||||
}
|
||||
line_id = log_line_pool.create(cr, uid, vals)
|
||||
return True
|
||||
|
||||
def log_fct(self, cr, uid_orig, model, method, fct_src, *args, **kw):
|
||||
"""
|
||||
Logging function: This function is performing the logging operation
|
||||
@param model: Object whose values are being changed
|
||||
@param method: method to log: create, read, write, unlink, action or workflow action
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
resource_pool = pool.get(model)
|
||||
model_pool = pool.get('ir.model')
|
||||
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
|
||||
model_id = model_ids and model_ids[0] or False
|
||||
assert model_id, _("'%s' Model does not exist..." %(model))
|
||||
model = model_pool.browse(cr, SUPERUSER_ID, model_id)
|
||||
|
||||
# fields to log. currently only used by log on read()
|
||||
field_list = []
|
||||
old_values = new_values = {}
|
||||
|
||||
if method == 'create':
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
if res:
|
||||
res_ids = [res]
|
||||
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
elif method == 'read':
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
# build the res_ids and the old_values dict. Here we don't use get_data() to
|
||||
# avoid performing an additional read()
|
||||
res_ids = []
|
||||
for record in res:
|
||||
res_ids.append(record['id'])
|
||||
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
|
||||
# log only the fields read
|
||||
field_list = args[1]
|
||||
elif method == 'unlink':
|
||||
res_ids = args[0]
|
||||
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
else: # method is write, action or workflow action
|
||||
res_ids = []
|
||||
if args:
|
||||
res_ids = args[0]
|
||||
if isinstance(res_ids, (long, int)):
|
||||
res_ids = [res_ids]
|
||||
if res_ids:
|
||||
# store the old values into a dictionary
|
||||
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
# process the original function, workflow trigger...
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
if method == 'copy':
|
||||
res_ids = [res]
|
||||
if res_ids:
|
||||
# check the new values and store them into a dictionary
|
||||
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
# compare the old and new values and create audittrail log if needed
|
||||
self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
|
||||
return res
|
||||
|
||||
def get_data(self, cr, uid, pool, res_ids, model, method):
|
||||
"""
|
||||
This function simply read all the fields of the given res_ids, and also recurisvely on
|
||||
all records of a x2m fields read that need to be logged. Then it returns the result in
|
||||
convenient structure that will be used as comparison basis.
|
||||
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID. This parameter is currently not used as every
|
||||
operation to get data is made as super admin. Though, it could be usefull later.
|
||||
:param pool: current db's pooler object.
|
||||
:param res_ids: Id's of resource to be logged/compared.
|
||||
:param model: Object whose values are being changed
|
||||
:param method: method to log: create, read, unlink, write, actions, workflow actions
|
||||
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
|
||||
{ (model_id, resource_id): { 'value': ...
|
||||
'textual_value': ...
|
||||
},
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param model: Object which values are being changed
|
||||
@param lines: List of values for line is to be created
|
||||
"""
|
||||
if lines is None:
|
||||
lines = []
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
obj_pool = pool.get(model.model)
|
||||
model_pool = pool.get('ir.model')
|
||||
field_pool = pool.get('ir.model.fields')
|
||||
log_line_pool = pool.get('audittrail.log.line')
|
||||
for line in lines:
|
||||
field_obj = obj_pool._all_columns.get(line['name'])
|
||||
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
|
||||
field_obj = field_obj.column
|
||||
old_value = line.get('old_value', '')
|
||||
new_value = line.get('new_value', '')
|
||||
search_models = [model.id]
|
||||
if obj_pool._inherits:
|
||||
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
|
||||
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
|
||||
if field_obj._type == 'many2one':
|
||||
old_value = old_value and old_value[0] or old_value
|
||||
new_value = new_value and new_value[0] or new_value
|
||||
vals = {
|
||||
"log_id": log_id,
|
||||
"field_id": field_id and field_id[0] or False,
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": line.get('old_value_text', ''),
|
||||
"new_value_text": line.get('new_value_text', ''),
|
||||
"field_description": field_obj.string
|
||||
}
|
||||
"""
|
||||
data = {}
|
||||
resource_pool = pool.get(model.model)
|
||||
# read all the fields of the given resources in super admin mode
|
||||
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids):
|
||||
values = {}
|
||||
values_text = {}
|
||||
resource_id = resource['id']
|
||||
# loop on each field on the res_ids we just have read
|
||||
for field in resource:
|
||||
if field in ('__last_update', 'id'):
|
||||
continue
|
||||
values[field] = resource[field]
|
||||
# get the textual value of that field for this record
|
||||
values_text[field] = self.get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
|
||||
line_id = log_line_pool.create(cr, uid, vals)
|
||||
return True
|
||||
|
||||
field_obj = resource_pool._all_columns.get(field).column
|
||||
if field_obj._type in ('one2many','many2many'):
|
||||
# check if an audittrail rule apply in super admin mode
|
||||
if self.check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
|
||||
# check if the model associated to a *2m field exists, in super admin mode
|
||||
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
|
||||
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
|
||||
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
|
||||
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
|
||||
field_resource_ids = list(set(resource[field]))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in field_resource_ids:
|
||||
field_resource_ids.remove(resource_id)
|
||||
data.update(self.get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
|
||||
|
||||
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
|
||||
return data
|
||||
def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw):
|
||||
"""
|
||||
Logging function: This function is performing the logging operation
|
||||
@param model: Object whose values are being changed
|
||||
@param method: method to log: create, read, write, unlink, action or workflow action
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
|
||||
"""
|
||||
This function compares the old data (i.e before the method was executed) and the new data
|
||||
(after the method was executed) and returns a structure with all the needed information to
|
||||
log those differences.
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
resource_pool = pool.get(model)
|
||||
model_pool = pool.get('ir.model')
|
||||
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
|
||||
model_id = model_ids and model_ids[0] or False
|
||||
assert model_id, _("'%s' Model does not exist..." %(model))
|
||||
model = model_pool.browse(cr, SUPERUSER_ID, model_id)
|
||||
|
||||
# fields to log. currently only used by log on read()
|
||||
field_list = []
|
||||
old_values = new_values = {}
|
||||
|
||||
if method == 'create':
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
if res:
|
||||
res_ids = [res]
|
||||
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
elif method == 'read':
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
# build the res_ids and the old_values dict. Here we don't use get_data() to
|
||||
# avoid performing an additional read()
|
||||
res_ids = []
|
||||
for record in res:
|
||||
res_ids.append(record['id'])
|
||||
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
|
||||
# log only the fields read
|
||||
field_list = args[1]
|
||||
elif method == 'unlink':
|
||||
res_ids = args[0]
|
||||
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
else: # method is write, action or workflow action
|
||||
res_ids = []
|
||||
if args:
|
||||
res_ids = args[0]
|
||||
if isinstance(res_ids, (long, int)):
|
||||
res_ids = [res_ids]
|
||||
if res_ids:
|
||||
# store the old values into a dictionary
|
||||
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
# process the original function, workflow trigger...
|
||||
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
|
||||
if method == 'copy':
|
||||
res_ids = [res]
|
||||
if res_ids:
|
||||
# check the new values and store them into a dictionary
|
||||
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
|
||||
# compare the old and new values and create audittrail log if needed
|
||||
process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
|
||||
return res
|
||||
|
||||
def get_data(cr, uid, pool, res_ids, model, method):
|
||||
"""
|
||||
This function simply read all the fields of the given res_ids, and also recurisvely on
|
||||
all records of a x2m fields read that need to be logged. Then it returns the result in
|
||||
convenient structure that will be used as comparison basis.
|
||||
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID. This parameter is currently not used as every
|
||||
operation to get data is made as super admin. Though, it could be usefull later.
|
||||
:param pool: current db's pooler object.
|
||||
:param model: model object which values are being changed
|
||||
:param resource_id: ID of record to which values are being changed
|
||||
:param res_ids: Id's of resource to be logged/compared.
|
||||
:param model: Object whose values are being changed
|
||||
:param method: method to log: create, read, unlink, write, actions, workflow actions
|
||||
:param old_values: dict of values read before execution of the method
|
||||
:param new_values: dict of values read after execution of the method
|
||||
:param field_list: optional argument containing the list of fields to log. Currently only
|
||||
used when performing a read, it could be usefull later on if we want to log the write
|
||||
on specific fields only.
|
||||
|
||||
:return: dictionary with
|
||||
* keys: tuples build as ID of model object to log and ID of resource to log
|
||||
* values: list of all the changes in field values for this couple (model, resource)
|
||||
return {
|
||||
(model.id, resource_id): []
|
||||
}
|
||||
|
||||
The reason why the structure returned is build as above is because when modifying an existing
|
||||
record, we may have to log a change done in a x2many field of that object
|
||||
"""
|
||||
if field_list is None:
|
||||
field_list = []
|
||||
key = (model.id, resource_id)
|
||||
lines = {
|
||||
key: []
|
||||
}
|
||||
# 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'):
|
||||
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
|
||||
{ (model_id, resource_id): { 'value': ...
|
||||
'textual_value': ...
|
||||
},
|
||||
}
|
||||
"""
|
||||
data = {}
|
||||
resource_pool = pool.get(model.model)
|
||||
# read all the fields of the given resources in super admin mode
|
||||
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids):
|
||||
values = {}
|
||||
values_text = {}
|
||||
resource_id = resource['id']
|
||||
# loop on each field on the res_ids we just have read
|
||||
for field in resource:
|
||||
if field 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
|
||||
field_obj = field_definition.column
|
||||
values[field] = resource[field]
|
||||
# get the textual value of that field for this record
|
||||
values_text[field] = get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
|
||||
|
||||
field_obj = resource_pool._all_columns.get(field).column
|
||||
if field_obj._type in ('one2many','many2many'):
|
||||
# checking if an audittrail rule apply in super admin mode
|
||||
if self.check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
|
||||
# checking if the model associated to a *2m field exists, in super admin mode
|
||||
# check if an audittrail rule apply in super admin mode
|
||||
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
|
||||
# check if the model associated to a *2m field exists, in super admin mode
|
||||
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
|
||||
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
|
||||
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
|
||||
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
|
||||
# the resource_ids that need to be checked are the sum of both old and previous values (because we
|
||||
# need to log also creation or deletion in those lists).
|
||||
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
|
||||
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
|
||||
# We use list(set(...)) to remove duplicates.
|
||||
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
|
||||
field_resource_ids = list(set(resource[field]))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in res_ids:
|
||||
res_ids.remove(resource_id)
|
||||
for res_id in res_ids:
|
||||
lines.update(self.prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
|
||||
# if the value value is different than the old value: record the change
|
||||
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
|
||||
data = {
|
||||
'name': field_name,
|
||||
'new_value': key in new_values and new_values[key]['value'].get(field_name),
|
||||
'old_value': key in old_values and old_values[key]['value'].get(field_name),
|
||||
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
|
||||
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
|
||||
}
|
||||
lines[key].append(data)
|
||||
return lines
|
||||
if resource_id in field_resource_ids:
|
||||
field_resource_ids.remove(resource_id)
|
||||
data.update(get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
|
||||
|
||||
def process_data(self, cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
|
||||
"""
|
||||
This function processes and iterates recursively to log the difference between the old
|
||||
data (i.e before the method was executed) and the new data and creates audittrail log
|
||||
accordingly.
|
||||
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
|
||||
return data
|
||||
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID,
|
||||
:param pool: current db's pooler object.
|
||||
:param res_ids: Id's of resource to be logged/compared.
|
||||
:param model: model object which values are being changed
|
||||
:param method: method to log: create, read, unlink, write, actions, workflow actions
|
||||
:param old_values: dict of values read before execution of the method
|
||||
:param new_values: dict of values read after execution of the method
|
||||
:param field_list: optional argument containing the list of fields to log. Currently only
|
||||
used when performing a read, it could be usefull later on if we want to log the write
|
||||
on specific fields only.
|
||||
:return: True
|
||||
"""
|
||||
if field_list is None:
|
||||
field_list = []
|
||||
# loop on all the given ids
|
||||
for res_id in res_ids:
|
||||
# compare old and new values and get audittrail log lines accordingly
|
||||
lines = self.prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
|
||||
def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
|
||||
"""
|
||||
This function compares the old data (i.e before the method was executed) and the new data
|
||||
(after the method was executed) and returns a structure with all the needed information to
|
||||
log those differences.
|
||||
|
||||
# if at least one modification has been found
|
||||
for model_id, resource_id in lines:
|
||||
name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1]
|
||||
vals = {
|
||||
'method': method,
|
||||
'object_id': model_id,
|
||||
'user_id': uid,
|
||||
'res_id': resource_id,
|
||||
'name': name,
|
||||
}
|
||||
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
|
||||
# the resource was not existing so we are forcing the method to 'create'
|
||||
# (because it could also come with the value 'write' if we are creating
|
||||
# new record through a one2many field)
|
||||
vals.update({'method': 'create'})
|
||||
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
|
||||
# the resource is not existing anymore so we are forcing the method to 'unlink'
|
||||
# (because it could also come with the value 'write' if we are deleting the
|
||||
# record through a one2many field)
|
||||
vals.update({'method': 'unlink'})
|
||||
# create the audittrail log in super admin mode, only if a change has been detected
|
||||
if lines[(model_id, resource_id)]:
|
||||
log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
|
||||
model = pool.get('ir.model').browse(cr, uid, model_id)
|
||||
self.create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
|
||||
return True
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID. This parameter is currently not used as every
|
||||
operation to get data is made as super admin. Though, it could be usefull later.
|
||||
:param pool: current db's pooler object.
|
||||
:param model: model object which values are being changed
|
||||
:param resource_id: ID of record to which values are being changed
|
||||
:param method: method to log: create, read, unlink, write, actions, workflow actions
|
||||
:param old_values: dict of values read before execution of the method
|
||||
:param new_values: dict of values read after execution of the method
|
||||
:param field_list: optional argument containing the list of fields to log. Currently only
|
||||
used when performing a read, it could be usefull later on if we want to log the write
|
||||
on specific fields only.
|
||||
|
||||
def check_rules(self, cr, uid, model, method):
|
||||
"""
|
||||
Checks if auditrails is installed for that db and then if one rule match
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID,
|
||||
@param model: value of _name of the object which values are being changed
|
||||
@param method: method to log: create, read, unlink,write,actions,workflow actions
|
||||
@return: True or False
|
||||
"""
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
if 'audittrail.rule' in pool.models:
|
||||
model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
|
||||
model_id = model_ids and model_ids[0] or False
|
||||
if model_id:
|
||||
rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
|
||||
for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
|
||||
if len(rule['user_id']) == 0 or uid in rule['user_id']:
|
||||
if rule.get('log_'+method,0):
|
||||
:return: dictionary with
|
||||
* keys: tuples build as ID of model object to log and ID of resource to log
|
||||
* values: list of all the changes in field values for this couple (model, resource)
|
||||
return {
|
||||
(model.id, resource_id): []
|
||||
}
|
||||
|
||||
The reason why the structure returned is build as above is because when modifying an existing
|
||||
record, we may have to log a change done in a x2many field of that object
|
||||
"""
|
||||
if field_list is None:
|
||||
field_list = []
|
||||
key = (model.id, resource_id)
|
||||
lines = {
|
||||
key: []
|
||||
}
|
||||
# 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
|
||||
field_obj = field_definition.column
|
||||
if field_obj._type in ('one2many','many2many'):
|
||||
# checking if an audittrail rule apply in super admin mode
|
||||
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
|
||||
# checking if the model associated to a *2m field exists, in super admin mode
|
||||
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
|
||||
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
|
||||
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
|
||||
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
|
||||
# the resource_ids that need to be checked are the sum of both old and previous values (because we
|
||||
# need to log also creation or deletion in those lists).
|
||||
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
|
||||
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
|
||||
# We use list(set(...)) to remove duplicates.
|
||||
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in res_ids:
|
||||
res_ids.remove(resource_id)
|
||||
for res_id in res_ids:
|
||||
lines.update(prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
|
||||
# if the value value is different than the old value: record the change
|
||||
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
|
||||
data = {
|
||||
'name': field_name,
|
||||
'new_value': key in new_values and new_values[key]['value'].get(field_name),
|
||||
'old_value': key in old_values and old_values[key]['value'].get(field_name),
|
||||
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
|
||||
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
|
||||
}
|
||||
lines[key].append(data)
|
||||
return lines
|
||||
|
||||
def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
|
||||
"""
|
||||
This function processes and iterates recursively to log the difference between the old
|
||||
data (i.e before the method was executed) and the new data and creates audittrail log
|
||||
accordingly.
|
||||
|
||||
:param cr: the current row, from the database cursor,
|
||||
:param uid: the current user’s ID,
|
||||
:param pool: current db's pooler object.
|
||||
:param res_ids: Id's of resource to be logged/compared.
|
||||
:param model: model object which values are being changed
|
||||
:param method: method to log: create, read, unlink, write, actions, workflow actions
|
||||
:param old_values: dict of values read before execution of the method
|
||||
:param new_values: dict of values read after execution of the method
|
||||
:param field_list: optional argument containing the list of fields to log. Currently only
|
||||
used when performing a read, it could be usefull later on if we want to log the write
|
||||
on specific fields only.
|
||||
:return: True
|
||||
"""
|
||||
if field_list is None:
|
||||
field_list = []
|
||||
# loop on all the given ids
|
||||
for res_id in res_ids:
|
||||
# compare old and new values and get audittrail log lines accordingly
|
||||
lines = prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
|
||||
|
||||
# if at least one modification has been found
|
||||
for model_id, resource_id in lines:
|
||||
name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1]
|
||||
vals = {
|
||||
'method': method,
|
||||
'object_id': model_id,
|
||||
'user_id': uid,
|
||||
'res_id': resource_id,
|
||||
'name': name,
|
||||
}
|
||||
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
|
||||
# the resource was not existing so we are forcing the method to 'create'
|
||||
# (because it could also come with the value 'write' if we are creating
|
||||
# new record through a one2many field)
|
||||
vals.update({'method': 'create'})
|
||||
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
|
||||
# the resource is not existing anymore so we are forcing the method to 'unlink'
|
||||
# (because it could also come with the value 'write' if we are deleting the
|
||||
# record through a one2many field)
|
||||
vals.update({'method': 'unlink'})
|
||||
# create the audittrail log in super admin mode, only if a change has been detected
|
||||
if lines[(model_id, resource_id)]:
|
||||
log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
|
||||
model = pool.get('ir.model').browse(cr, uid, model_id)
|
||||
create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
|
||||
return True
|
||||
|
||||
def check_rules(cr, uid, model, method):
|
||||
"""
|
||||
Checks if auditrails is installed for that db and then if one rule match
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID,
|
||||
@param model: value of _name of the object which values are being changed
|
||||
@param method: method to log: create, read, unlink,write,actions,workflow actions
|
||||
@return: True or False
|
||||
"""
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
if 'audittrail.rule' in pool.models:
|
||||
model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
|
||||
model_id = model_ids and model_ids[0] or False
|
||||
if model_id:
|
||||
rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
|
||||
for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
|
||||
if len(rule['user_id']) == 0 or uid in rule['user_id']:
|
||||
if rule.get('log_'+method,0):
|
||||
return True
|
||||
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
|
||||
if rule['log_action']:
|
||||
return True
|
||||
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
|
||||
if rule['log_action']:
|
||||
return True
|
||||
|
||||
def execute_cr(self, cr, uid, model, method, *args, **kw):
|
||||
fct_src = super(audittrail_objects_proxy, self).execute_cr
|
||||
if self.check_rules(cr,uid,model,method):
|
||||
return self.log_fct(cr, uid, model, method, fct_src, *args, **kw)
|
||||
return fct_src(cr, uid, model, method, *args, **kw)
|
||||
# Replace the openerp.service.model functions.
|
||||
|
||||
def exec_workflow_cr(self, cr, uid, model, method, *args, **kw):
|
||||
fct_src = super(audittrail_objects_proxy, self).exec_workflow_cr
|
||||
if self.check_rules(cr,uid,model,'workflow'):
|
||||
return self.log_fct(cr, uid, model, method, fct_src, *args, **kw)
|
||||
return fct_src(cr, uid, model, method, *args, **kw)
|
||||
original_execute_cr = openerp.service.model.execute_cr
|
||||
original_exec_workflow_cr = openerp.service.model.exec_workflow_cr
|
||||
|
||||
audittrail_objects_proxy()
|
||||
def execute_cr(cr, uid, model, method, *args, **kw):
|
||||
fct_src = original_execute_cr
|
||||
if check_rules(cr,uid,model,method):
|
||||
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
|
||||
return fct_src(cr, uid, model, method, *args, **kw)
|
||||
|
||||
def exec_workflow_cr(cr, uid, model, method, *args, **kw):
|
||||
fct_src = original_exec_workflow_cr
|
||||
if check_rules(cr,uid,model,'workflow'):
|
||||
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
|
||||
return fct_src(cr, uid, model, method, *args, **kw)
|
||||
|
||||
openerp.service.model.execute_cr = execute_cr
|
||||
openerp.service.model.exec_workflow_cr = exec_workflow_cr
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,75 +1,28 @@
|
||||
# Russian translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-03 16:03+0000\n"
|
||||
"PO-Revision-Date: 2012-12-07 08:15+0000\n"
|
||||
"Last-Translator: Denis Karataev <dskarataev@gmail.com>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2013-02-13 09:46+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Russian <ru@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-08 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16341)\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-14 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: base_crypt
|
||||
#: model:ir.model,name:base_crypt.model_res_users
|
||||
#. module: auth_crypt
|
||||
#: field:res.users,password_crypt:0
|
||||
msgid "Encrypted Password"
|
||||
msgstr "Зашифрованный пароль"
|
||||
|
||||
#. module: auth_crypt
|
||||
#: model:ir.model,name:auth_crypt.model_res_users
|
||||
msgid "Users"
|
||||
msgstr "Пользователи"
|
||||
|
||||
#~ msgid "res.users"
|
||||
#~ msgstr "res.users"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Error"
|
||||
#~ msgstr "Error"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Please specify the password !"
|
||||
#~ msgstr "Необходимо указать пароль!"
|
||||
|
||||
#~ msgid "The chosen company is not in the allowed companies for this user"
|
||||
#~ msgstr ""
|
||||
#~ "Выбранная организация отсутствует в списке разрешённых для этого пользователя"
|
||||
|
||||
#~ msgid "You can not have two users with the same login !"
|
||||
#~ msgstr "Не может быть двух пользователей с одинаковым именем пользователя!"
|
||||
|
||||
#~ msgid "Base - Password Encryption"
|
||||
#~ msgstr "Основной - Шифрование паролей"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "This module replaces the cleartext password in the database with a password "
|
||||
#~ "hash,\n"
|
||||
#~ "preventing anyone from reading the original password.\n"
|
||||
#~ "For your existing user base, the removal of the cleartext passwords occurs "
|
||||
#~ "the first time\n"
|
||||
#~ "a user logs into the database, after installing base_crypt.\n"
|
||||
#~ "After installing this module it won't be possible to recover a forgotten "
|
||||
#~ "password for your\n"
|
||||
#~ "users, the only solution is for an admin to set a new password.\n"
|
||||
#~ "\n"
|
||||
#~ "Note: installing this module does not mean you can ignore basic security "
|
||||
#~ "measures,\n"
|
||||
#~ "as the password is still transmitted unencrypted on the network (by the "
|
||||
#~ "client),\n"
|
||||
#~ "unless you are using a secure protocol such as XML-RPCS.\n"
|
||||
#~ " "
|
||||
#~ msgstr ""
|
||||
#~ "Этот модуль заменяет текстовые пароли в базе данных на их хэши,\n"
|
||||
#~ "предотвращая хищение оригинальных паролей.\n"
|
||||
#~ "Для существующей базы пользователей, удаление текстового пароля происходит "
|
||||
#~ "при\n"
|
||||
#~ "первом входе пользователя после установки base_crypt.\n"
|
||||
#~ "После установки этого модуля станет невозможно восстановление пароля \n"
|
||||
#~ "пользователя. Возможна будет только замена пароля.\n"
|
||||
#~ "\n"
|
||||
#~ "Прим.: установка этого модуля не избавляет от необходимости соблюдать\n"
|
||||
#~ "базовые меры безопасности, поскольку пароли всё ещё передаются открытым\n"
|
||||
#~ "текстом по сети, если не используется безопасный протокол вроде XML-RPCS.\n"
|
||||
#~ " "
|
||||
|
||||
@@ -2,8 +2,10 @@ import functools
|
||||
import logging
|
||||
|
||||
import simplejson
|
||||
import werkzeug.utils
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
import openerp.addons.web.http as oeweb
|
||||
from openerp.addons.web.controllers.main import db_monodb, set_cookie_and_redirect, login_and_redirect
|
||||
@@ -69,6 +71,13 @@ class OAuthController(oeweb.Controller):
|
||||
# auth_signup is not installed
|
||||
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,))
|
||||
url = "/#action=login&oauth_error=1"
|
||||
except openerp.exceptions.AccessDenied:
|
||||
# oauth credentials not valid, user could be on a temporary session
|
||||
_logger.info('OAuth2: access denied, redirect to main page in case a valid session exists, without setting cookies')
|
||||
url = "/#action=login&oauth_error=3"
|
||||
redirect = werkzeug.utils.redirect(url, 303)
|
||||
redirect.autocorrect_location_header = False
|
||||
return redirect
|
||||
except Exception, e:
|
||||
# signup error
|
||||
_logger.exception("OAuth2: %s" % str(e))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Russian translation for openobject-addons
|
||||
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2013-02-13 09:46+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Russian <ru@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-14 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: auth_oauth_signup
|
||||
#: model:ir.model,name:auth_oauth_signup.model_res_users
|
||||
msgid "Users"
|
||||
msgstr "Пользователи"
|
||||
@@ -36,6 +36,8 @@ class res_users(osv.Model):
|
||||
login = super(res_users, self)._auth_oauth_signin(cr, uid, provider, validation, params, context=context)
|
||||
|
||||
except openerp.exceptions.AccessDenied:
|
||||
if context and context.get('no_user_creation'):
|
||||
return None
|
||||
state = simplejson.loads(params['state'])
|
||||
token = state.get('t')
|
||||
oauth_uid = validation['user_id']
|
||||
|
||||
@@ -24,12 +24,13 @@ from dateutil import parser
|
||||
from dateutil import rrule
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.service import web_services
|
||||
from openerp.tools.translate import _
|
||||
import pytz
|
||||
import re
|
||||
import time
|
||||
|
||||
from openerp import tools, SUPERUSER_ID
|
||||
import openerp.service.report
|
||||
|
||||
months = {
|
||||
1: "January", 2: "February", 3: "March", 4: "April", \
|
||||
@@ -1729,27 +1730,25 @@ class ir_model(osv.osv):
|
||||
|
||||
ir_model()
|
||||
|
||||
class virtual_report_spool(web_services.report_spool):
|
||||
original_exp_report = openerp.service.report.exp_report
|
||||
|
||||
def exp_report(self, db, uid, object, ids, data=None, context=None):
|
||||
"""
|
||||
Export Report
|
||||
@param self: The object pointer
|
||||
@param db: get the current database,
|
||||
@param uid: the current user's ID for security checks,
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
def exp_report(db, uid, object, ids, data=None, context=None):
|
||||
"""
|
||||
Export Report
|
||||
@param db: get the current database,
|
||||
@param uid: the current user's ID for security checks,
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
if object == 'printscreen.list':
|
||||
return super(virtual_report_spool, self).exp_report(db, uid, \
|
||||
object, ids, data, context)
|
||||
new_ids = []
|
||||
for id in ids:
|
||||
new_ids.append(base_calendar_id2real_id(id))
|
||||
if data.get('id', False):
|
||||
data['id'] = base_calendar_id2real_id(data['id'])
|
||||
return super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, data, context)
|
||||
if object == 'printscreen.list':
|
||||
original_exp_report(db, uid, object, ids, data, context)
|
||||
new_ids = []
|
||||
for id in ids:
|
||||
new_ids.append(base_calendar_id2real_id(id))
|
||||
if data.get('id', False):
|
||||
data['id'] = base_calendar_id2real_id(data['id'])
|
||||
return original_exp_report(db, uid, object, new_ids, data, context)
|
||||
|
||||
virtual_report_spool()
|
||||
openerp.service.report.exp_report = exp_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -234,11 +234,12 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Meetings">
|
||||
<field name="name" string="Meeting" filter_domain="[('name','ilike',self)]"/>
|
||||
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||
<field name="partner_ids"/>
|
||||
<field name="categ_ids"/>
|
||||
<field name="user_id"/>
|
||||
<separator/>
|
||||
<filter string="My Meetings" help="My Meetings" domain="[('user_id','=',uid)]"/>
|
||||
<field name="user_id"/>
|
||||
<field name="partner_ids"/>
|
||||
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
+180
-31
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2012-12-14 22:33+0000\n"
|
||||
"Last-Translator: Goran Kliska <gkliska@gmail.com>\n"
|
||||
"PO-Revision-Date: 2013-02-12 22:11+0000\n"
|
||||
"Last-Translator: Davor Bojkić <bole@dajmi5.com>\n"
|
||||
"Language-Team: Croatian <hr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-22 06:07+0000\n"
|
||||
"X-Generator: Launchpad (build 16378)\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-13 04:36+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -29,7 +29,7 @@ msgstr "Dohvati sve moguće vrijednosti"
|
||||
#: code:addons/base_import/static/src/xml/import.xml:71
|
||||
#, python-format
|
||||
msgid "Need to import data from an other application?"
|
||||
msgstr ""
|
||||
msgstr "Potreban je uvoz podataka iz druge aplikacije?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -47,6 +47,15 @@ msgid ""
|
||||
"give \n"
|
||||
" you an example for Products and their Categories."
|
||||
msgstr ""
|
||||
"Kada koristite vanjske ID-eve, možete uvesti csv datoteke \n"
|
||||
" sa kolonom \"External ID\" "
|
||||
"definirate vanjski ID svakog zapisa \n"
|
||||
" koji uvozite. Tada ćete biti "
|
||||
"u mogućnosti napraviti referencu \n"
|
||||
" na taj zapis sa kolonama tipa "
|
||||
"\"polje/External ID\". Sljedeća dvije \n"
|
||||
" csv datoteke daju primjer za "
|
||||
"proizvode i njihove kategorije."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -56,13 +65,16 @@ msgid ""
|
||||
"How to export/import different tables from an SQL \n"
|
||||
" application to OpenERP?"
|
||||
msgstr ""
|
||||
"Kako izvesti/uvesti različite tablice iz SQL \n"
|
||||
" "
|
||||
"programa u OpenERP"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/js/import.js:310
|
||||
#, python-format
|
||||
msgid "Relation Fields"
|
||||
msgstr ""
|
||||
msgstr "Relacijska polja"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -72,6 +84,9 @@ msgid ""
|
||||
"Country/Database ID: the unique OpenERP ID for a \n"
|
||||
" record, defined by the ID postgresql column"
|
||||
msgstr ""
|
||||
"Država/ID baze: jedinstveni OpenERP ID za \n"
|
||||
" "
|
||||
" zapis, definran kolonom postgres kolonom ID"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -87,6 +102,16 @@ msgid ""
|
||||
"\n"
|
||||
" have a unique Database ID)"
|
||||
msgstr ""
|
||||
"Korištenje \n"
|
||||
" Država/ID "
|
||||
"BAze : ovo bi trebali rijetko koristiti\n"
|
||||
" za "
|
||||
"označavanje. Ovo je većinom korišteno od strane programera\n"
|
||||
" jer je "
|
||||
"glavna prednost ovoga to što nikad nema konflikata \n"
|
||||
" (možete "
|
||||
"imati više zapisa istog naziva, ali uvjek sa jedinstvenim IDentifikatorom u "
|
||||
"Bazi)"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -96,6 +121,9 @@ msgid ""
|
||||
"For the country \n"
|
||||
" Belgium, you can use one of these 3 ways to import:"
|
||||
msgstr ""
|
||||
"Za državu \n"
|
||||
" "
|
||||
" Belgiju, možete koristiti jedan od ova 3 načina uza uvoz:"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -121,13 +149,20 @@ msgid ""
|
||||
"companies) TO \n"
|
||||
" '/tmp/company.csv' with CSV HEADER;"
|
||||
msgstr ""
|
||||
"kopirajte \n"
|
||||
" (select "
|
||||
"'company_'||id as \"External ID\",company_name\n"
|
||||
" as "
|
||||
"\"Name\",'True' as \"Is a Company\" from companies) TO\n"
|
||||
" "
|
||||
"'/tmp/company.csv' with CSV HEADER;"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:206
|
||||
#, python-format
|
||||
msgid "CSV file for Manufacturer, Retailer"
|
||||
msgstr ""
|
||||
msgstr "CSV datoteka za Proizvođače, Veletrgovce"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -139,6 +174,11 @@ msgid ""
|
||||
"\n"
|
||||
" data from a third party application."
|
||||
msgstr ""
|
||||
"Koristi \n"
|
||||
" Država/Vanjski ID. "
|
||||
"koristite vanjski ID kad uvozite \n"
|
||||
" podatke iz drugih "
|
||||
"aplikacija."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -152,7 +192,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/xml/import.xml:80
|
||||
#, python-format
|
||||
msgid "XXX/External ID"
|
||||
msgstr ""
|
||||
msgstr "XXX/Vanjski ID"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -181,6 +221,14 @@ msgid ""
|
||||
"\n"
|
||||
" See the following question."
|
||||
msgstr ""
|
||||
"Primjetite da vaša csv datoteka \n"
|
||||
" ima tabulator za "
|
||||
"odvajanje, a OpenERP neće \n"
|
||||
" primjetiti ta odvajanja. "
|
||||
"Morate promjineiti format \n"
|
||||
" zapisa u vašem tabličnom "
|
||||
"kalkulatoru. \n"
|
||||
" Vidi sljedeće pitanje."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -199,7 +247,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/xml/import.xml:239
|
||||
#, python-format
|
||||
msgid "Can I import several times the same record?"
|
||||
msgstr ""
|
||||
msgstr "Mogu li isti zapis uvesti nekoliko puta?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -213,7 +261,7 @@ msgstr "Potvrdi"
|
||||
#: code:addons/base_import/static/src/xml/import.xml:55
|
||||
#, python-format
|
||||
msgid "Map your data to OpenERP"
|
||||
msgstr ""
|
||||
msgstr "Mapirajte vaše podatke na OpenERP"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -224,6 +272,10 @@ msgid ""
|
||||
" the easiest way when your data come from CSV files \n"
|
||||
" that have been created manually."
|
||||
msgstr ""
|
||||
"Korištenje Države: ovo je \n"
|
||||
" najlakši način kada vaši "
|
||||
"podaci dolaze iz csv datoteka\n"
|
||||
" koje su sastavljene ručno."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -233,6 +285,8 @@ msgid ""
|
||||
"What's the difference between Database ID and \n"
|
||||
" External ID?"
|
||||
msgstr ""
|
||||
"Koja je razlika izmeži ID Baze i \n"
|
||||
" vanjski ID?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -244,25 +298,30 @@ msgid ""
|
||||
"\n"
|
||||
" you 3 different fields to import:"
|
||||
msgstr ""
|
||||
"Na primjer, \n"
|
||||
" referenciranje države "
|
||||
"kontakta, OpenERP predlaže \n"
|
||||
" 3 različita polja za "
|
||||
"uvoz :"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:175
|
||||
#, python-format
|
||||
msgid "What can I do if I have multiple matches for a field?"
|
||||
msgstr ""
|
||||
msgstr "Što da radim ako imam više istih zapisa za polje?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:302
|
||||
#, python-format
|
||||
msgid "External ID,Name,Is a Company"
|
||||
msgstr ""
|
||||
msgstr "Vanjski ID , Naziv, Je Tvrtka"
|
||||
|
||||
#. module: base_import
|
||||
#: field:base_import.tests.models.preview,somevalue:0
|
||||
msgid "Some Value"
|
||||
msgstr ""
|
||||
msgstr "Neka vrijednost"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -272,6 +331,9 @@ msgid ""
|
||||
"The following CSV file shows how to import \n"
|
||||
" suppliers and their respective contacts"
|
||||
msgstr ""
|
||||
"Sljedeća csv datoteka pokazuje kako uvesti \n"
|
||||
" "
|
||||
" dobavljače i njihove pripadne kontakte"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -281,6 +343,9 @@ msgid ""
|
||||
"How can I change the CSV file format options when \n"
|
||||
" saving in my spreadsheet application?"
|
||||
msgstr ""
|
||||
"Kako da promijenim opcije csv formata \n"
|
||||
" "
|
||||
"kada spremam datoteku u tabličnom kalkulatoru?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -301,6 +366,21 @@ msgid ""
|
||||
"orignial \n"
|
||||
" database)."
|
||||
msgstr ""
|
||||
"kako možete vidjeti iz ove datoteke, Fabien i Laurence \n"
|
||||
" "
|
||||
" rade za organizaciju Biggies (company_1), a \n"
|
||||
" "
|
||||
" Eric radi za Organi. Pozezivanje osoba i "
|
||||
"organizacija se radi \n"
|
||||
" "
|
||||
" korištenjem Vanjskog ID-a organizacije. Morali smo "
|
||||
"staviti prefix \n"
|
||||
" "
|
||||
" naziva tablice na Vanjski ID da izbjegnemo konflikt "
|
||||
"istog ID-a osobe \n"
|
||||
" "
|
||||
" i organizacije (osoba_1 i organizacija_1 koji dijele "
|
||||
"isti ID u originalnoj bazi)."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -315,13 +395,20 @@ msgid ""
|
||||
"\n"
|
||||
" '/tmp/person.csv' with CSV"
|
||||
msgstr ""
|
||||
"kopirajte \n"
|
||||
" (select'person_'||id as \"External ID\",person_name "
|
||||
"as\n"
|
||||
" \"Name\",'False' as \"Is a "
|
||||
"Company\",'company_'||company_id\n"
|
||||
" as \"Related Company/External ID\" from persons) TO\n"
|
||||
" '/tmp/person.csv' with CSV"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:148
|
||||
#, python-format
|
||||
msgid "Country: Belgium"
|
||||
msgstr ""
|
||||
msgstr "Država : Belgija"
|
||||
|
||||
#. module: base_import
|
||||
#: model:ir.model,name:base_import.model_base_import_tests_models_char_stillreadonly
|
||||
@@ -342,7 +429,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/xml/import.xml:233
|
||||
#, python-format
|
||||
msgid "Suppliers and their respective contacts"
|
||||
msgstr ""
|
||||
msgstr "Dobavljači i njihovi pripadni kontakti"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -375,6 +462,11 @@ msgid ""
|
||||
"\n"
|
||||
" PSQL:"
|
||||
msgstr ""
|
||||
"Za stvaranje csv datoteke za osobe povezane sa \n"
|
||||
" "
|
||||
" organizacijama, koristimo ljedeću SQL naredbu u \n"
|
||||
" "
|
||||
" PSQL:"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -386,6 +478,13 @@ msgid ""
|
||||
" (in 'Save As' dialog box > click 'Tools' dropdown \n"
|
||||
" list > Encoding tab)."
|
||||
msgstr ""
|
||||
"Microsoft Excell će vam omogućiti \n"
|
||||
" da promjenite kodnu stranu "
|
||||
"jedino kod snimanja \n"
|
||||
" (U 'Save as' dijalogu > "
|
||||
"kliknite na 'Tools' padajući izbornik > \n"
|
||||
" odaberite 'Encoding' "
|
||||
"karticu)"
|
||||
|
||||
#. module: base_import
|
||||
#: field:base_import.tests.models.preview,othervalue:0
|
||||
@@ -402,6 +501,13 @@ msgid ""
|
||||
" later, it's thus good practice to specify it\n"
|
||||
" whenever possible"
|
||||
msgstr ""
|
||||
"će također biti korišteno za ažuriranje originalnog \n"
|
||||
" "
|
||||
"uvoza, ako kasnije trebate ponovo uvesti \n"
|
||||
" "
|
||||
"izmjenjene podatke, zato se smatra dobrom praksom \n"
|
||||
" "
|
||||
"koristiti kad god je moguće"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -411,6 +517,9 @@ msgid ""
|
||||
"file to import. If you need a sample importable file, you\n"
|
||||
" can use the export tool to generate one."
|
||||
msgstr ""
|
||||
"datoteka za uvoz. Ako trebate uzorak datoteke koja se može uvesti,\n"
|
||||
" možete koristiti "
|
||||
"alat za izvoz da napravite jednu."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -419,7 +528,7 @@ msgstr ""
|
||||
msgid ""
|
||||
"Country/Database \n"
|
||||
" ID: 21"
|
||||
msgstr ""
|
||||
msgstr "Država/Baza"
|
||||
|
||||
#. module: base_import
|
||||
#: model:ir.model,name:base_import.model_base_import_tests_models_char
|
||||
@@ -429,14 +538,14 @@ msgstr ""
|
||||
#. module: base_import
|
||||
#: help:base_import.import,file:0
|
||||
msgid "File to check and/or import, raw binary (not base64)"
|
||||
msgstr ""
|
||||
msgstr "Datoteke za provjeru i/ili uvoz, raw binary ( ne base64)"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:230
|
||||
#, python-format
|
||||
msgid "Purchase orders with their respective purchase order lines"
|
||||
msgstr ""
|
||||
msgstr "Narudžbe i njihove pripadne stavke"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -448,6 +557,14 @@ msgid ""
|
||||
" field corresponding to the column. This makes imports\n"
|
||||
" simpler especially when the file has many columns."
|
||||
msgstr ""
|
||||
"Ako datoteka sadrži\n"
|
||||
" nazive kolona, OpenERP može "
|
||||
"pokušati \n"
|
||||
" automatski odrediti polja koja "
|
||||
"odgovaraju kolonama. \n"
|
||||
" Ovo čini uvoz jednostavnijim "
|
||||
"pogotovo ako datoteka ima \n"
|
||||
" mnogo kolona."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -464,6 +581,8 @@ msgid ""
|
||||
". The issue is\n"
|
||||
" usually an incorrect file encoding."
|
||||
msgstr ""
|
||||
". Problem je \n"
|
||||
" obično netočna kodna strana."
|
||||
|
||||
#. module: base_import
|
||||
#: model:ir.model,name:base_import.model_base_import_tests_models_m2o_required
|
||||
@@ -519,7 +638,7 @@ msgstr "ID baze podataka"
|
||||
#: code:addons/base_import/static/src/xml/import.xml:313
|
||||
#, python-format
|
||||
msgid "It will produce the following CSV file:"
|
||||
msgstr ""
|
||||
msgstr "Će napraviti sljedeću csv datoteku:"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -548,7 +667,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/xml/import.xml:360
|
||||
#, python-format
|
||||
msgid "Import preview failed due to:"
|
||||
msgstr ""
|
||||
msgstr "Predpregled uvoza nije uspio zbog:"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -643,7 +762,7 @@ msgstr "Uvezi CSV datoteku"
|
||||
#: code:addons/base_import/static/src/js/import.js:74
|
||||
#, python-format
|
||||
msgid "Quoting:"
|
||||
msgstr ""
|
||||
msgstr "Navođenje:"
|
||||
|
||||
#. module: base_import
|
||||
#: model:ir.model,name:base_import.model_base_import_tests_models_m2o_required_related
|
||||
@@ -670,7 +789,7 @@ msgstr "Uvoz"
|
||||
#: code:addons/base_import/static/src/js/import.js:407
|
||||
#, python-format
|
||||
msgid "Here are the possible values:"
|
||||
msgstr ""
|
||||
msgstr "Evo mogućih vrijednosti:"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -687,13 +806,15 @@ msgid ""
|
||||
"A single column was found in the file, this often means the file separator "
|
||||
"is incorrect"
|
||||
msgstr ""
|
||||
"U datoteci je nađena samo jedna kolona, to često znači da je format "
|
||||
"razdjelnika neispravan."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/xml/import.xml:293
|
||||
#, python-format
|
||||
msgid "dump of such a PostgreSQL database"
|
||||
msgstr ""
|
||||
msgstr "dump takve PostgereSQL baze"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -710,6 +831,9 @@ msgid ""
|
||||
"The following CSV file shows how to import purchase \n"
|
||||
" orders with their respective purchase order lines:"
|
||||
msgstr ""
|
||||
"Sljedeća csv datoteka pokazuje kako uvesti \n"
|
||||
" naloge za nabavu sa "
|
||||
"njihovm pripadnim stavkama :"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -719,6 +843,9 @@ msgid ""
|
||||
"What can I do when the Import preview table isn't \n"
|
||||
" displayed correctly?"
|
||||
msgstr ""
|
||||
"Što mogu uraditi kada se tablice Predpregleda za uvoz\n"
|
||||
" "
|
||||
" ne prikazuju ispravno?"
|
||||
|
||||
#. module: base_import
|
||||
#: field:base_import.tests.models.char,value:0
|
||||
@@ -770,7 +897,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/js/import.js:396
|
||||
#, python-format
|
||||
msgid "(%d more)"
|
||||
msgstr ""
|
||||
msgstr "(%d više)"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -829,7 +956,7 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/js/import.js:373
|
||||
#, python-format
|
||||
msgid "Everything seems valid."
|
||||
msgstr ""
|
||||
msgstr "Sve se čini u redu."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -914,6 +1041,15 @@ msgid ""
|
||||
" will set the EMPTY value in the field, instead of \n"
|
||||
" assigning the default value."
|
||||
msgstr ""
|
||||
"Ako ne postavite sva polja u vašoj csv datoteci, \n"
|
||||
" OpenERP će "
|
||||
"dodijeliti zadane vrijednosti za svako \n"
|
||||
" nedefinirano "
|
||||
"polje, ali ako postavite polja sa praznim virjenostima u csv-u \n"
|
||||
" OpenERP će "
|
||||
"postaviti vrijednost tih polja na \"PRAZNO\", umjesto da im \n"
|
||||
" dodijeli zadane "
|
||||
"vrijednosti"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -930,6 +1066,9 @@ msgid ""
|
||||
"What happens if I do not provide a value for a \n"
|
||||
" specific field?"
|
||||
msgstr ""
|
||||
"Što se dešava ako ne dajem vrijednost za \n"
|
||||
" "
|
||||
"pojedino polje?"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -957,6 +1096,11 @@ msgid ""
|
||||
"spreadsheet \n"
|
||||
" application."
|
||||
msgstr ""
|
||||
"Ovo vam \n"
|
||||
" omogućuje da "
|
||||
"koristite alat za Uvoz/Izvoz OpenERP-a \n"
|
||||
" za izmjenu serija "
|
||||
"zapisa u vašem omiljenom tabličnom kalkulatoru"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -993,14 +1137,14 @@ msgstr ""
|
||||
#: code:addons/base_import/static/src/xml/import.xml:169
|
||||
#, python-format
|
||||
msgid "CSV file for categories"
|
||||
msgstr ""
|
||||
msgstr "CSV datoteka za kategorije"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/js/import.js:309
|
||||
#, python-format
|
||||
msgid "Normal Fields"
|
||||
msgstr ""
|
||||
msgstr "Normalna polja"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -1012,6 +1156,11 @@ msgid ""
|
||||
" identifier from the original application and\n"
|
||||
" map it to the"
|
||||
msgstr ""
|
||||
"kako bi ponovo napravili relacije između\n"
|
||||
" "
|
||||
"različitih zapisa, trebali bi koristiti jedinstveni\n"
|
||||
" "
|
||||
"identifikator iz originalnog zapisa i njega mapirati na"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -1054,7 +1203,7 @@ msgstr "Naziv"
|
||||
#: code:addons/base_import/static/src/xml/import.xml:80
|
||||
#, python-format
|
||||
msgid "to the original unique identifier."
|
||||
msgstr ""
|
||||
msgstr "originalni jedinstveni identifikator"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -1131,14 +1280,14 @@ msgstr "Vanjski ID"
|
||||
#: code:addons/base_import/static/src/xml/import.xml:39
|
||||
#, python-format
|
||||
msgid "File Format Options…"
|
||||
msgstr ""
|
||||
msgstr "Opcije Formata datoteka..."
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
#: code:addons/base_import/static/src/js/import.js:392
|
||||
#, python-format
|
||||
msgid "between rows %d and %d"
|
||||
msgstr ""
|
||||
msgstr "između reda %d i %d"
|
||||
|
||||
#. module: base_import
|
||||
#. openerp-web
|
||||
@@ -1163,4 +1312,4 @@ msgstr ""
|
||||
#. module: base_import
|
||||
#: field:base_import.import,file:0
|
||||
msgid "File"
|
||||
msgstr ""
|
||||
msgstr "Datoteka"
|
||||
|
||||
@@ -567,7 +567,8 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
for opportunity in opportunities:
|
||||
subject.append(opportunity.name)
|
||||
title = "%s : %s" % (opportunity.type == 'opportunity' and _('Merged opportunity') or _('Merged lead'), opportunity.name)
|
||||
details.append(self._mail_body(cr, uid, opportunity, CRM_LEAD_FIELDS_TO_MERGE, title=title, context=context))
|
||||
fields = list(CRM_LEAD_FIELDS_TO_MERGE)
|
||||
details.append(self._mail_body(cr, uid, opportunity, fields, title=title, context=context))
|
||||
|
||||
# Chatter message's subject
|
||||
subject = subject[0] + ": " + ", ".join(subject[1:])
|
||||
@@ -627,7 +628,10 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
opportunities = self.browse(cr, uid, ids, context=context)
|
||||
sequenced_opps = []
|
||||
for opportunity in opportunities:
|
||||
sequenced_opps.append((opportunity.stage_id and opportunity.stage_id.state != 'cancel' and opportunity.stage_id.sequence or 0, opportunity))
|
||||
if opportunity.stage_id and opportunity.stage_id.state != 'cancel':
|
||||
sequenced_opps.append((opportunity.stage_id.sequence, opportunity))
|
||||
else:
|
||||
sequenced_opps.append((-1, opportunity))
|
||||
sequenced_opps.sort(key=lambda tup: tup[0], reverse=True)
|
||||
opportunities = [opportunity for sequence, opportunity in sequenced_opps]
|
||||
ids = [opportunity.id for opportunity in opportunities]
|
||||
@@ -636,7 +640,8 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
|
||||
tail_opportunities = opportunities_rest
|
||||
|
||||
merged_data = self._merge_data(cr, uid, ids, highest, CRM_LEAD_FIELDS_TO_MERGE, context=context)
|
||||
fields = list(CRM_LEAD_FIELDS_TO_MERGE)
|
||||
merged_data = self._merge_data(cr, uid, ids, highest, fields, context=context)
|
||||
|
||||
# Merge messages and attachements into the first opportunity
|
||||
self._merge_opportunity_history(cr, uid, highest.id, tail_opportunities, context=context)
|
||||
@@ -651,7 +656,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
section_stages = self.pool.get('crm.case.section').read(cr, uid, merged_data['section_id'], ['stage_ids'], context=context)
|
||||
if merged_data.get('stage_id') not in section_stages['stage_ids']:
|
||||
stages_sequences = self.pool.get('crm.case.stage').search(cr, uid, [('id','in',section_stages['stage_ids'])], order='sequence', limit=1, context=context)
|
||||
merged_data['stage_id'] = stages_sequences[0]
|
||||
merged_data['stage_id'] = stages_sequences and stages_sequences[0] or False
|
||||
# Write merged data into first opportunity
|
||||
self.write(cr, uid, [highest.id], merged_data, context=context)
|
||||
# Delete tail opportunities
|
||||
|
||||
@@ -327,6 +327,7 @@
|
||||
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
|
||||
<field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
|
||||
<field name="user_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="country_id" context="{'invisible_country': False}"/>
|
||||
<separator/>
|
||||
|
||||
@@ -58,11 +58,11 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||
|
||||
if partner_id:
|
||||
# Search for opportunities that have the same partner and that arent done or cancelled
|
||||
ids = lead_obj.search(cr, uid, [('partner_id', '=', partner_id)])
|
||||
ids = lead_obj.search(cr, uid, [('partner_id', '=', partner_id), ('state', '!=', 'done')])
|
||||
for id in ids:
|
||||
tomerge.add(id)
|
||||
if email:
|
||||
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0])])
|
||||
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0]), ('state', '!=', 'done')])
|
||||
for id in ids:
|
||||
tomerge.add(id)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -67,7 +67,7 @@
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -62,5 +62,66 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_lead_geo_assign_form" model="ir.ui.view">
|
||||
<field name="name">crm.lead.lead.geo_assign.inherit</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//notebook/page[@string='Extra Info']" position="after">
|
||||
<page string="Assignation">
|
||||
<group name="partner_assign_group">
|
||||
<group string="Partner Assignation">
|
||||
<field name="partner_assigned_id" on_change="onchange_assign_id(partner_assigned_id)" domain="[('grade_id','<>',False)]"/>
|
||||
<label for="date_assign"/>
|
||||
<div>
|
||||
<field name="date_assign"/>
|
||||
<button string="Forward"
|
||||
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="terp-mail-forward" type="action"
|
||||
context="{'default_composition_mode': 'forward', 'default_partner_ids': [partner_assigned_id]}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Geo Assignation">
|
||||
<field name="partner_latitude"/>
|
||||
<field name="partner_longitude"/>
|
||||
<span/>
|
||||
<button string="Geo Assign" name="action_assign_partner" type="object" colspan="1"
|
||||
icon="gtk-apply"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_lead_geo_assign_tree" model="ir.ui.view">
|
||||
<field name="name">crm.lead.lead.geo_assign.tree.inherit</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_tree_view_leads"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="after">
|
||||
<field name="partner_assigned_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="crm_lead_partner_filter">
|
||||
<field name="name">crm.lead.partner.filter.assigned</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.view_crm_case_leads_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter string="Team" position="after">
|
||||
<filter string="Assigned Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_assigned_id'}"/>
|
||||
</filter>
|
||||
|
||||
<field name="partner_id" position="after">
|
||||
<field name="partner_assigned_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -31,11 +31,11 @@ from StringIO import StringIO
|
||||
import psycopg2
|
||||
|
||||
import openerp
|
||||
from openerp import netsvc
|
||||
from openerp import pooler
|
||||
from openerp import tools
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.osv.orm import except_orm
|
||||
import openerp.report.interface
|
||||
from openerp.tools.misc import ustr
|
||||
from openerp.tools.translate import _
|
||||
from openerp.tools.safe_eval import safe_eval
|
||||
@@ -456,7 +456,7 @@ class document_directory_content(osv.osv):
|
||||
if node.extension != '.pdf':
|
||||
raise Exception("Invalid content: %s" % node.extension)
|
||||
report = self.pool.get('ir.actions.report.xml').browse(cr, uid, node.report_id, context=context)
|
||||
srv = netsvc.Service._services['report.'+report.report_name]
|
||||
srv = openerp.report.interface.report_int._reports['report.'+report.report_name]
|
||||
ctx = node.context.context.copy()
|
||||
ctx.update(node.dctx)
|
||||
pdf,pdftype = srv.create(cr, uid, [node.act_id,], {}, context=ctx)
|
||||
|
||||
@@ -10,6 +10,7 @@ import glob
|
||||
import fnmatch
|
||||
|
||||
from openerp import pooler, netsvc, sql_db
|
||||
import openerp.service
|
||||
from openerp.service import security
|
||||
from openerp.osv import osv
|
||||
|
||||
@@ -60,7 +61,7 @@ class abstracted_fs(object):
|
||||
def db_list(self):
|
||||
"""Get the list of available databases, with FTPd support
|
||||
"""
|
||||
s = netsvc.ExportService.getService('db')
|
||||
s = openerp.service.db
|
||||
result = s.exp_list(document=True)
|
||||
self.db_name_list = []
|
||||
for db_name in result:
|
||||
|
||||
@@ -38,6 +38,7 @@ except ImportError:
|
||||
|
||||
import openerp
|
||||
from openerp import pooler, sql_db, netsvc
|
||||
import openerp.service
|
||||
from openerp.tools import misc
|
||||
|
||||
from cache import memoize
|
||||
@@ -372,7 +373,7 @@ class openerp_dav_handler(dav_interface):
|
||||
@memoize(4)
|
||||
def _all_db_list(self):
|
||||
"""return all databases who have module document_webdav installed"""
|
||||
s = netsvc.ExportService.getService('db')
|
||||
s = openerp.service.db
|
||||
result = s.exp_list()
|
||||
self.db_name_list=[]
|
||||
for db_name in result:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import simplejson
|
||||
import urllib
|
||||
|
||||
import openerp.addons.web.http as openerpweb
|
||||
import openerp.addons.web.controllers.main as webmain
|
||||
@@ -14,11 +15,15 @@ class EDI(openerpweb.Controller):
|
||||
modules_json = simplejson.dumps(modules)
|
||||
js = "\n ".join('<script type="text/javascript" src="%s"></script>' % i for i in webmain.manifest_list(req, modules_str, 'js'))
|
||||
css = "\n ".join('<link rel="stylesheet" href="%s">' % i for i in webmain.manifest_list(req, modules_str, 'css'))
|
||||
|
||||
# `url` may contain a full URL with a valid query string, we basically want to watch out for XML brackets and double-quotes
|
||||
safe_url = urllib.quote_plus(url,':/?&;=')
|
||||
|
||||
return webmain.html_template % {
|
||||
'js': js,
|
||||
'css': css,
|
||||
'modules': modules_json,
|
||||
'init': 's.edi.edi_import("%s");' % url,
|
||||
'init': 's.edi.edi_import("%s");' % safe_url,
|
||||
}
|
||||
|
||||
@openerpweb.jsonrequest
|
||||
|
||||
+34
-33
@@ -21,45 +21,46 @@
|
||||
import logging
|
||||
|
||||
import openerp
|
||||
import openerp.netsvc as netsvc
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class edi(netsvc.ExportService):
|
||||
# TODO this is not needed anymore:
|
||||
# - the exposed new service just forward to the model service
|
||||
# - the service is called by the web controller, which can
|
||||
# now directly call into openerp as the web server is always
|
||||
# embedded in openerp.
|
||||
|
||||
def __init__(self, name="edi"):
|
||||
netsvc.ExportService.__init__(self, name)
|
||||
def _edi_dispatch(db_name, method_name, *method_args):
|
||||
try:
|
||||
registry = openerp.modules.registry.RegistryManager.get(db_name)
|
||||
assert registry, 'Unknown database %s' % db_name
|
||||
edi = registry['edi.edi']
|
||||
cr = registry.db.cursor()
|
||||
res = None
|
||||
res = getattr(edi, method_name)(cr, *method_args)
|
||||
cr.commit()
|
||||
except Exception, e:
|
||||
_logger.exception('Failed to execute EDI method %s with args %r.',
|
||||
method_name, method_args)
|
||||
raise
|
||||
finally:
|
||||
cr.close()
|
||||
return res
|
||||
|
||||
def _edi_dispatch(self, db_name, method_name, *method_args):
|
||||
try:
|
||||
registry = openerp.modules.registry.RegistryManager.get(db_name)
|
||||
assert registry, 'Unknown database %s' % db_name
|
||||
edi = registry['edi.edi']
|
||||
cr = registry.db.cursor()
|
||||
res = None
|
||||
res = getattr(edi, method_name)(cr, *method_args)
|
||||
cr.commit()
|
||||
except Exception:
|
||||
_logger.exception('Failed to execute EDI method %s with args %r.', method_name, method_args)
|
||||
raise
|
||||
finally:
|
||||
cr.close()
|
||||
return res
|
||||
def exp_import_edi_document(db_name, uid, passwd, edi_document, context=None):
|
||||
return _edi_dispatch(db_name, 'import_edi', uid, edi_document, None)
|
||||
|
||||
def exp_import_edi_document(self, db_name, uid, passwd, edi_document, context=None):
|
||||
return self._edi_dispatch(db_name, 'import_edi', uid, edi_document, None)
|
||||
def exp_import_edi_url(db_name, uid, passwd, edi_url, context=None):
|
||||
return _edi_dispatch(db_name, 'import_edi', uid, None, edi_url)
|
||||
|
||||
def exp_import_edi_url(self, db_name, uid, passwd, edi_url, context=None):
|
||||
return self._edi_dispatch(db_name, 'import_edi', uid, None, edi_url)
|
||||
@openerp.http.rpc('edi')
|
||||
def dispatch(method, params):
|
||||
if method in ['import_edi_document', 'import_edi_url']:
|
||||
(db, uid, passwd) = params[0:3]
|
||||
openerp.service.security.check(db, uid, passwd)
|
||||
else:
|
||||
raise KeyError("Method not found: %s." % method)
|
||||
fn = globals()['exp_' + method]
|
||||
return fn(*params)
|
||||
|
||||
def dispatch(self, method, params):
|
||||
if method in ['import_edi_document', 'import_edi_url']:
|
||||
(db, uid, passwd ) = params[0:3]
|
||||
openerp.service.security.check(db, uid, passwd)
|
||||
else:
|
||||
raise KeyError("Method not found: %s." % method)
|
||||
fn = getattr(self, 'exp_'+method)
|
||||
return fn(*params)
|
||||
|
||||
edi()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import time
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
@@ -152,7 +151,6 @@ class hr_expense_expense(osv.osv):
|
||||
account_journal = self.pool.get('account.journal')
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
wkf_service = netsvc.LocalService("workflow")
|
||||
if context is None:
|
||||
context = {}
|
||||
for exp in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
import datetime
|
||||
import time
|
||||
from itertools import groupby
|
||||
from operator import itemgetter
|
||||
from operator import attrgetter, itemgetter
|
||||
|
||||
import math
|
||||
from openerp import netsvc
|
||||
from openerp import tools
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
@@ -304,10 +303,8 @@ class hr_holidays(osv.osv):
|
||||
'manager_id': False,
|
||||
'manager_id2': False,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_delete(uid, 'hr.holidays', id, cr)
|
||||
wf_service.trg_create(uid, 'hr.holidays', id, cr)
|
||||
self.delete_workflow(cr, uid, ids)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
to_unlink = []
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
for record2 in record.linked_request_ids:
|
||||
@@ -370,11 +367,11 @@ class hr_holidays(osv.osv):
|
||||
'employee_id': emp.id
|
||||
}
|
||||
leave_ids.append(self.create(cr, uid, vals, context=None))
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for leave_id in leave_ids:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
# TODO is it necessary to interleave the calls?
|
||||
self.signal_confirm(cr, uid, [leave_id])
|
||||
self.signal_validate(cr, uid, [leave_id])
|
||||
self.signal_second_validate(cr, uid, [leave_id])
|
||||
return True
|
||||
|
||||
def holidays_confirm(self, cr, uid, ids, context=None):
|
||||
@@ -404,9 +401,7 @@ class hr_holidays(osv.osv):
|
||||
meeting_obj.unlink(cr, uid, [record.meeting_id.id])
|
||||
|
||||
# If a category that created several holidays, cancel all related
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for request in record.linked_request_ids or []:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', request.id, 'refuse', cr)
|
||||
self.signal_refuse(cr, uid, map(attrgetter('id'), record.linked_request_ids or []))
|
||||
|
||||
self._remove_resource_leave(cr, uid, ids, context=context)
|
||||
return True
|
||||
@@ -478,10 +473,9 @@ class hr_employee(osv.osv):
|
||||
leave_id = holiday_obj.create(cr, uid, {'name': _('Leave Request for %s') % employee.name, 'employee_id': employee.id, 'holiday_status_id': status_id, 'type': 'remove', 'holiday_type': 'employee', 'number_of_days_temp': abs(diff)}, context=context)
|
||||
else:
|
||||
return False
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
holidays_obj.signal_confirm(cr, uid, [leave_id])
|
||||
holidays_obj.signal_validate(cr, uid, [leave_id])
|
||||
holidays_obj.signal_second_validate(cr, uid, [leave_id])
|
||||
return True
|
||||
|
||||
def _get_remaining_days(self, cr, uid, ids, name, args, context=None):
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
I again set to draft and then confirm.
|
||||
-
|
||||
!python {model: hr.holidays}: |
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self.set_to_draft(cr, uid, [ref('hr_holidays_employee1_cl')])
|
||||
wf_service.trg_validate(uid, 'hr.holidays', ref('hr_holidays_employee1_cl'), 'confirm', cr)
|
||||
self.set_to_draft(cr, uid, [ref('hr_holidays_employee1_cl')])
|
||||
self.signal_confirm(cr, uid, [ref('hr_holidays_employee1_cl')])
|
||||
-
|
||||
I validate the holiday request by clicking on "To Approve" button.
|
||||
-
|
||||
|
||||
@@ -26,7 +26,6 @@ from datetime import datetime
|
||||
from datetime import timedelta
|
||||
from dateutil import relativedelta
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import tools
|
||||
from openerp.tools.translate import _
|
||||
@@ -331,13 +330,12 @@ class hr_payslip(osv.osv):
|
||||
|
||||
def refund_sheet(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for payslip in self.browse(cr, uid, ids, context=context):
|
||||
id_copy = self.copy(cr, uid, payslip.id, {'credit_note': True, 'name': _('Refund: ')+payslip.name}, context=context)
|
||||
self.compute_sheet(cr, uid, [id_copy], context=context)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', id_copy, 'hr_verify_sheet', cr)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', id_copy, 'process_sheet', cr)
|
||||
|
||||
self.signal_hr_verify_sheet(cr, uid, [id_copy])
|
||||
self.signal_process_sheet(cr, uid, [id_copy])
|
||||
|
||||
form_id = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_form')
|
||||
form_res = form_id and form_id[1] or False
|
||||
tree_id = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_tree')
|
||||
|
||||
@@ -104,10 +104,8 @@
|
||||
I want to check cancel button. So I first cancel the sheet then make it set to draft.
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self.cancel_sheet(cr, uid, [ref("hr_payslip_0")], None)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', ref("hr_payslip_0"), 'draft', cr)
|
||||
self.signal_draft(cr, uid, [ref("hr_payslip_0")])
|
||||
-
|
||||
Then I click on the "Confirm" button.
|
||||
-
|
||||
|
||||
@@ -371,7 +371,6 @@ class hr_applicant(base_stage, osv.Model):
|
||||
update_vals = {}
|
||||
|
||||
update_vals.update({
|
||||
'description': msg.get('body'),
|
||||
'email_from': msg.get('from'),
|
||||
'email_cc': msg.get('cc'),
|
||||
})
|
||||
|
||||
@@ -187,6 +187,8 @@
|
||||
domain="[('date_action','<>',False)]" help="Filter and view on next actions and date"/>
|
||||
<field name="job_id"/>
|
||||
<field name="user_id"/>
|
||||
<separator/>
|
||||
<field name="categ_ids"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
|
||||
@@ -115,6 +115,4 @@
|
||||
I click on "Create Invoice" button to create Invoice and validate the invoice.
|
||||
-
|
||||
!python {model: hr.timesheet.invoice.create.final}: |
|
||||
from openerp import netsvc
|
||||
wkf_service = netsvc.LocalService("workflow")
|
||||
res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]})
|
||||
|
||||
@@ -114,6 +114,4 @@
|
||||
I click on "Create Invoice" button to create Invoice and validate the invoice.
|
||||
-
|
||||
!python {model: hr.timesheet.invoice.create.final}: |
|
||||
from openerp import netsvc
|
||||
wkf_service = netsvc.LocalService("workflow")
|
||||
res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]})
|
||||
|
||||
@@ -25,7 +25,6 @@ from dateutil.relativedelta import relativedelta
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
|
||||
class hr_timesheet_sheet(osv.osv):
|
||||
_name = "hr_timesheet_sheet.sheet"
|
||||
@@ -93,8 +92,7 @@ class hr_timesheet_sheet(osv.osv):
|
||||
self.check_employee_attendance_state(cr, uid, sheet.id, context=context)
|
||||
di = sheet.user_id.company_id.timesheet_max_difference
|
||||
if (abs(sheet.total_difference) < di) or not di:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
|
||||
self.signal_confirm(cr, uid, [sheet.id])
|
||||
else:
|
||||
raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
|
||||
return True
|
||||
@@ -192,9 +190,7 @@ class hr_timesheet_sheet(osv.osv):
|
||||
|
||||
def action_set_to_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state': 'draft'})
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
for id in ids:
|
||||
wf_service.trg_create(uid, self._name, id, cr)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
|
||||
+25
-16
@@ -7,24 +7,24 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2011-02-01 10:13+0000\n"
|
||||
"Last-Translator: Krisztian Eyssen <krisz@eyssen.hu>\n"
|
||||
"PO-Revision-Date: 2013-02-14 15:58+0000\n"
|
||||
"Last-Translator: krnkris <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-22 05:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16378)\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-15 04:38+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: knowledge
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "Documents"
|
||||
msgstr ""
|
||||
msgstr "Dokumentumok"
|
||||
|
||||
#. module: knowledge
|
||||
#: model:ir.model,name:knowledge.model_knowledge_config_settings
|
||||
msgid "knowledge.config.settings"
|
||||
msgstr ""
|
||||
msgstr "knowledge.config.settings"
|
||||
|
||||
#. module: knowledge
|
||||
#: help:knowledge.config.settings,module_document_webdav:0
|
||||
@@ -32,11 +32,13 @@ msgid ""
|
||||
"Access your documents in OpenERP through WebDAV.\n"
|
||||
" This installs the module document_webdav."
|
||||
msgstr ""
|
||||
"Az OpenERP dokumentumok WebDAV-on keresztüli elérése.\n"
|
||||
" Ez a document_webdav modult telepíti."
|
||||
|
||||
#. module: knowledge
|
||||
#: help:knowledge.config.settings,module_document_page:0
|
||||
msgid "This installs the module document_page."
|
||||
msgstr ""
|
||||
msgstr "Ez a document_page modult telepíti."
|
||||
|
||||
#. module: knowledge
|
||||
#: model:ir.ui.menu,name:knowledge.menu_document2
|
||||
@@ -47,12 +49,12 @@ msgstr "Csoportmunában készült tartalom"
|
||||
#: model:ir.actions.act_window,name:knowledge.action_knowledge_configuration
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "Configure Knowledge"
|
||||
msgstr ""
|
||||
msgstr "Tudástár beállítása"
|
||||
|
||||
#. module: knowledge
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "Knowledge and Documents Management"
|
||||
msgstr ""
|
||||
msgstr "Tudástár és dokumentum kezelés"
|
||||
|
||||
#. module: knowledge
|
||||
#: help:knowledge.config.settings,module_document:0
|
||||
@@ -62,31 +64,36 @@ msgid ""
|
||||
"and a document dashboard.\n"
|
||||
" This installs the module document."
|
||||
msgstr ""
|
||||
"Ez egy komplett dokumentum kezelő rendszer, beleértve: felhasználó "
|
||||
"hitelesítást,\n"
|
||||
" teljes dokumentum keresőt (de a pptx és docx nem "
|
||||
"támogatott), és egy dokumentum vezérlőpultot.\n"
|
||||
" Ez a document modult telepíti."
|
||||
|
||||
#. module: knowledge
|
||||
#: field:knowledge.config.settings,module_document_page:0
|
||||
msgid "Create static web pages"
|
||||
msgstr ""
|
||||
msgstr "Statikus weboldalak készítése"
|
||||
|
||||
#. module: knowledge
|
||||
#: field:knowledge.config.settings,module_document_ftp:0
|
||||
msgid "Share repositories (FTP)"
|
||||
msgstr ""
|
||||
msgstr "Elérési út (FTP) megosztás"
|
||||
|
||||
#. module: knowledge
|
||||
#: field:knowledge.config.settings,module_document:0
|
||||
msgid "Manage documents"
|
||||
msgstr ""
|
||||
msgstr "Dokumentum kezelés"
|
||||
|
||||
#. module: knowledge
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
msgstr "Mégsem"
|
||||
|
||||
#. module: knowledge
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "Apply"
|
||||
msgstr ""
|
||||
msgstr "Alkalmaz"
|
||||
|
||||
#. module: knowledge
|
||||
#: model:ir.ui.menu,name:knowledge.menu_document_configuration
|
||||
@@ -99,16 +106,18 @@ msgid ""
|
||||
"Access your documents in OpenERP through an FTP interface.\n"
|
||||
" This installs the module document_ftp."
|
||||
msgstr ""
|
||||
"Az OpenERP dokumentumok elérése egy FTP csatolón keresztül.\n"
|
||||
" Ez a document_ftp modult telepíti."
|
||||
|
||||
#. module: knowledge
|
||||
#: view:knowledge.config.settings:0
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
msgstr "vagy"
|
||||
|
||||
#. module: knowledge
|
||||
#: field:knowledge.config.settings,module_document_webdav:0
|
||||
msgid "Share repositories (WebDAV)"
|
||||
msgstr ""
|
||||
msgstr "Elérési útvonal (webDAV) megosztás"
|
||||
|
||||
#. module: knowledge
|
||||
#: model:ir.ui.menu,name:knowledge.menu_document
|
||||
|
||||
@@ -26,7 +26,6 @@ from calendar import isleap
|
||||
|
||||
from openerp.tools.translate import _
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
DATETIME_FORMAT = "%Y-%m-%d"
|
||||
@@ -179,7 +178,6 @@ class hr_payslip_run(osv.osv):
|
||||
return res
|
||||
|
||||
def create_advice(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
payslip_pool = self.pool.get('hr.payslip')
|
||||
payslip_line_pool = self.pool.get('hr.payslip.line')
|
||||
advice_pool = self.pool.get('hr.payroll.advice')
|
||||
@@ -198,8 +196,9 @@ class hr_payslip_run(osv.osv):
|
||||
advice_id = advice_pool.create(cr, uid, advice_data, context=context)
|
||||
slip_ids = []
|
||||
for slip_id in run.slip_ids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id.id, 'hr_verify_sheet', cr)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id.id, 'process_sheet', cr)
|
||||
# TODO is it necessary to interleave the calls ?
|
||||
payslip_pool.signal_hr_verify_sheet(cr, uid, [slip_id.id])
|
||||
payslip_pool.signal_process_sheet(cr, uid, [slip_id.id])
|
||||
slip_ids.append(slip_id.id)
|
||||
|
||||
for slip in payslip_pool.browse(cr, uid, slip_ids, context=context):
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
# Hungarian translation for openobject-addons
|
||||
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:06+0000\n"
|
||||
"PO-Revision-Date: 2013-02-14 16:15+0000\n"
|
||||
"Last-Translator: krnkris <Unknown>\n"
|
||||
"Language-Team: Hungarian <hu@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-15 04:38+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_fiscal_position_template
|
||||
msgid "Template for Fiscal Position"
|
||||
msgstr "ÁFA pozíció sablon"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: sql_constraint:account.account:0
|
||||
msgid "The code of the account must be unique per company !"
|
||||
msgstr "A főkönyvi számla számának egyedinek kell lennie!"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.account.template:0
|
||||
msgid ""
|
||||
"Configuration Error!\n"
|
||||
"You can not define children to an account with internal type different of "
|
||||
"\"View\"! "
|
||||
msgstr ""
|
||||
"Beállítási hiba!\n"
|
||||
"Nem tud al-számlát létrehozni egy számlához, melynek a belső \"Nézet\" "
|
||||
"típusa különböző! "
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_analytic_journal
|
||||
msgid "Analytic Journal"
|
||||
msgstr "Analitikus/Gyüjtő napló"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.account.template:0
|
||||
msgid "Error ! You can not create recursive account templates."
|
||||
msgstr "Hiba! Nem hozhat létre rekurzív főkönyvi számla sablonokat."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_journal
|
||||
msgid "Journal"
|
||||
msgstr "Napló"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_chart_template
|
||||
msgid "Templates for Account Chart"
|
||||
msgstr "Számlatükör sablonok"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: sql_constraint:account.tax:0
|
||||
msgid "The description must be unique per company!"
|
||||
msgstr "A leírás egyedi kell legyen minden vállalathoz!"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.tax.code.template:0
|
||||
msgid "Error ! You can not create recursive Tax Codes."
|
||||
msgstr "Hiba! Nem hozhat létre rekurzív adógyűjtőket."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_tax_template
|
||||
msgid "account.tax.template"
|
||||
msgstr "account.tax.template"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_tax
|
||||
msgid "account.tax"
|
||||
msgstr "account.tax"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_account
|
||||
msgid "Account"
|
||||
msgstr "Főkönyvi számla"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_wizard_multi_charts_accounts
|
||||
msgid "wizard.multi.charts.accounts"
|
||||
msgstr "wizard.multi.charts.accounts"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.journal:0
|
||||
msgid ""
|
||||
"Configuration error! The currency chosen should be shared by the default "
|
||||
"accounts too."
|
||||
msgstr ""
|
||||
"Beállítási hiba! A választott pénznemet meg kell osztani az alapértelmezett "
|
||||
"főkönyvi számlával is."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_account_template
|
||||
msgid "Templates for Accounts"
|
||||
msgstr "Főkönyvi számla sablonok"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: help:account.chart.template,spoken_languages:0
|
||||
msgid ""
|
||||
"State here the languages for which the translations of templates could be "
|
||||
"loaded at the time of installation of this localization module and copied in "
|
||||
"the final object when generating them from templates. You must provide the "
|
||||
"language codes separated by ';'"
|
||||
msgstr ""
|
||||
"Adja meg itt a nyelvet amelyen a sablon be fog töltődni a lokalizációs modul "
|
||||
"telepítése után és az át lesz másolva a végső objektumba a sablonokból való "
|
||||
"létrehozás után. A nyelvi kódot ';' kell elválasztani."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.account:0
|
||||
msgid "Error ! You can not create recursive accounts."
|
||||
msgstr "Hiba! Nem hozhat létre rekurzív számlákat."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.account:0
|
||||
msgid ""
|
||||
"Configuration Error! \n"
|
||||
"You can not select an account type with a deferral method different of "
|
||||
"\"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! "
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The name of the journal must be unique per company !"
|
||||
msgstr "A napló nevének egyedinek kell lennie mindegyik vállalatra!"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_analytic_account
|
||||
msgid "Analytic Account"
|
||||
msgstr "Analitikus/elemző könyvelés"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The code of the journal must be unique per company !"
|
||||
msgstr "A napló kódjának egyedinek kell lennie mindegyik vállalathoz!"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_fiscal_position
|
||||
msgid "Fiscal Position"
|
||||
msgstr "Költségvetési pozíció"
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.account:0
|
||||
msgid ""
|
||||
"Configuration Error! \n"
|
||||
"You can not define children to an account with internal type different of "
|
||||
"\"View\"! "
|
||||
msgstr ""
|
||||
"Beállítási hiba! \n"
|
||||
"Nem tud al-számlát létrehozni egy számlához, melynek a belső \"Nézet\" "
|
||||
"típusa különböző! "
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: constraint:account.analytic.account:0
|
||||
msgid "Error! You can not create recursive analytic accounts."
|
||||
msgstr "Hiba! Nem hozhat létre rekurzív gyűjtőkódokat."
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: model:ir.model,name:l10n_multilang.model_account_tax_code_template
|
||||
msgid "Tax Code Template"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_multilang
|
||||
#: field:account.chart.template,spoken_languages:0
|
||||
msgid "Spoken Languages"
|
||||
msgstr "Beszélt nyelvek"
|
||||
@@ -159,7 +159,7 @@ class lunch_order(osv.Model):
|
||||
def specific_function(cr, uid, ids, context=None):
|
||||
return self.add_preference(cr, uid, ids, pref_id, context=context)
|
||||
return specific_function
|
||||
return super(lunch_order,self).__getattr__(self,attr)
|
||||
return super(lunch_order, self).__getattr__(attr)
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
"""
|
||||
|
||||
+287
-169
File diff suppressed because it is too large
Load Diff
@@ -310,8 +310,8 @@ class mail_message(osv.Model):
|
||||
partner_tree = dict((partner[0], partner) for partner in partners)
|
||||
|
||||
# 2. Attachments as SUPERUSER, because could receive msg and attachments for doc uid cannot see
|
||||
attachments = ir_attachment_obj.read(cr, SUPERUSER_ID, list(attachment_ids), ['id', 'datas_fname'], context=context)
|
||||
attachments_tree = dict((attachment['id'], {'id': attachment['id'], 'filename': attachment['datas_fname']}) for attachment in attachments)
|
||||
attachments = ir_attachment_obj.read(cr, SUPERUSER_ID, list(attachment_ids), ['id', 'datas_fname', 'name'], context=context)
|
||||
attachments_tree = dict((attachment['id'], {'id': attachment['id'], 'filename': attachment['datas_fname'], 'name': attachment['name']}) for attachment in attachments)
|
||||
|
||||
# 3. Update message dictionaries
|
||||
for message_dict in messages:
|
||||
|
||||
@@ -773,7 +773,7 @@ class mail_thread(osv.AbstractModel):
|
||||
msg_dict['author_id'] = author_ids[0]
|
||||
else:
|
||||
msg_dict['email_from'] = message.get('from')
|
||||
partner_ids = self._message_find_partners(cr, uid, message, ['From', 'To', 'Cc'], context=context)
|
||||
partner_ids = self._message_find_partners(cr, uid, message, ['To', 'Cc'], context=context)
|
||||
msg_dict['partner_ids'] = [(4, partner_id) for partner_id in partner_ids]
|
||||
|
||||
if 'Date' in message:
|
||||
|
||||
@@ -104,8 +104,8 @@ openerp.mail = function (session) {
|
||||
// returns the file type of a file based on its extension
|
||||
// As it only looks at the extension it is quite approximative.
|
||||
filetype: function(url){
|
||||
url = url.filename || url;
|
||||
var tokens = (url+'').split('.');
|
||||
var url = url && url.filename || url;
|
||||
var tokens = typeof url == 'string' ? url.split('.') : [];
|
||||
if(tokens.length <= 1){
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
+18
-16
@@ -7,19 +7,19 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2011-01-31 14:00+0000\n"
|
||||
"Last-Translator: Krisztian Eyssen <krisz@eyssen.hu>\n"
|
||||
"PO-Revision-Date: 2013-02-14 16:51+0000\n"
|
||||
"Last-Translator: krnkris <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-22 05:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16378)\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-15 04:38+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: marketing
|
||||
#: model:ir.model,name:marketing.model_marketing_config_settings
|
||||
msgid "marketing.config.settings"
|
||||
msgstr ""
|
||||
msgstr "marketing.config.settings"
|
||||
|
||||
#. module: marketing
|
||||
#: help:marketing.config.settings,module_marketing_campaign_crm_demo:0
|
||||
@@ -33,7 +33,7 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:marketing.action_marketing_configuration
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "Configure Marketing"
|
||||
msgstr ""
|
||||
msgstr "Értékesítés beállítás"
|
||||
|
||||
#. module: marketing
|
||||
#: view:crm.lead:0
|
||||
@@ -44,47 +44,47 @@ msgstr "Marketing"
|
||||
#. module: marketing
|
||||
#: field:marketing.config.settings,module_marketing_campaign:0
|
||||
msgid "Marketing campaigns"
|
||||
msgstr ""
|
||||
msgstr "Értékesítési kampány"
|
||||
|
||||
#. module: marketing
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
msgstr "vagy"
|
||||
|
||||
#. module: marketing
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "Campaigns"
|
||||
msgstr ""
|
||||
msgstr "Kampányok"
|
||||
|
||||
#. module: marketing
|
||||
#: model:res.groups,name:marketing.group_marketing_manager
|
||||
msgid "Manager"
|
||||
msgstr ""
|
||||
msgstr "Igazgató"
|
||||
|
||||
#. module: marketing
|
||||
#: model:res.groups,name:marketing.group_marketing_user
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
msgstr "Felhasználó"
|
||||
|
||||
#. module: marketing
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "Campaigns Settings"
|
||||
msgstr ""
|
||||
msgstr "Kampány beállítások"
|
||||
|
||||
#. module: marketing
|
||||
#: field:marketing.config.settings,module_crm_profiling:0
|
||||
msgid "Track customer profile to focus your campaigns"
|
||||
msgstr ""
|
||||
msgstr "Vevő profil nyomonkövetése a kampányra összpontosítva"
|
||||
|
||||
#. module: marketing
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
msgstr "Mégsem"
|
||||
|
||||
#. module: marketing
|
||||
#: view:marketing.config.settings:0
|
||||
msgid "Apply"
|
||||
msgstr ""
|
||||
msgstr "Alkalmaz"
|
||||
|
||||
#. module: marketing
|
||||
#: help:marketing.config.settings,module_marketing_campaign:0
|
||||
@@ -101,11 +101,13 @@ msgid ""
|
||||
"Allows users to perform segmentation within partners.\n"
|
||||
" This installs the module crm_profiling."
|
||||
msgstr ""
|
||||
"A felhasználóknak engedélyezi a partnerek kiválogatását.\n"
|
||||
" Ez telepíti a crm_profiling modult."
|
||||
|
||||
#. module: marketing
|
||||
#: field:marketing.config.settings,module_marketing_campaign_crm_demo:0
|
||||
msgid "Demo data for marketing campaigns"
|
||||
msgstr ""
|
||||
msgstr "Demo adatok a merketing kampányhoz"
|
||||
|
||||
#~ msgid "Configure Your Marketing Application"
|
||||
#~ msgstr "Marketing alkalmazásainak beállítása"
|
||||
|
||||
@@ -7,14 +7,14 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2011-01-21 15:22+0000\n"
|
||||
"Last-Translator: Krisztian Eyssen <krisz@eyssen.hu>\n"
|
||||
"PO-Revision-Date: 2013-02-13 12:33+0000\n"
|
||||
"Last-Translator: krnkris <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-22 05:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16378)\n"
|
||||
"X-Launchpad-Export-Date: 2013-02-14 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16491)\n"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_8
|
||||
@@ -28,6 +28,14 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Köszönjük érdeklődésedet és feliratkozásodat a műszaki "
|
||||
"képzésre.</p>\n"
|
||||
" Egyéb, további felmerülő kérdésekben állunk rendelkezésre. "
|
||||
"Nagyon köszönjük együttműködésedet.</p>\n"
|
||||
" <p>Ha további információra van szükség, küldj választ erre az "
|
||||
"üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapata,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:ir.actions.report.xml,name:marketing_campaign_crm_demo.mc_crm_lead_demo_report
|
||||
@@ -37,7 +45,7 @@ msgstr "Marketingkampány demojelentés"
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_8
|
||||
msgid "Thanks for subscribing to technical training"
|
||||
msgstr ""
|
||||
msgstr "Köszönjük a feliratkozást a műszaki képzésre"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_3
|
||||
@@ -49,6 +57,12 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Köszönjük érdeklődésedet és feliratkozásodat az OpenERP "
|
||||
"felfedező napra.</p>\n"
|
||||
" <p>Ha további információra van szükség, küldj válasz választ "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapat,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: report:crm.lead.demo:0
|
||||
@@ -58,7 +72,7 @@ msgstr "Vállalat :"
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_4
|
||||
msgid "Thanks for buying the OpenERP book"
|
||||
msgstr ""
|
||||
msgstr "Köszönjük, hogy megvásárolta az OpenERP könyvet"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_6
|
||||
@@ -71,16 +85,23 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Van egy nagyon jó ajánlatunk ami megfelelhet Önnek.\n"
|
||||
" Az ezüst tagjainknak, mi fizetjük a műszaki oktatást 2013 "
|
||||
"Júniusában.</p>\n"
|
||||
" <p>Ha további információra van szükség, küldj válasz választ "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapat,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_1
|
||||
msgid "Thanks for showing interest in OpenERP"
|
||||
msgstr ""
|
||||
msgstr "Köszönjük érdeklődését az OpenERP iránt"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:ir.actions.server,name:marketing_campaign_crm_demo.action_dummy
|
||||
msgid "Dummy Action"
|
||||
msgstr ""
|
||||
msgstr "Látszólagos művelet"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: report:crm.lead.demo:0
|
||||
@@ -98,6 +119,13 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>an egy nagyon jó ajánlatunk ami megfelelhet Önnek.\n"
|
||||
" Ajánljuk, hogy iratkozzon fel az OpenERP felfedező napra 2013 "
|
||||
"májusában.</p>\n"
|
||||
" <p>Ha további információra van szükség, küldj válasz választ "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapat,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_5
|
||||
@@ -110,26 +138,33 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>an egy nagyon jó ajánlatunk ami megfelelhet Önnek.\n"
|
||||
" Az arany partnereknek, mi szervezzük az ingyenes oktatást 2013 "
|
||||
"Júniusában.</p>\n"
|
||||
" <p>Ha további információra van szükség, küldj válasz választ "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapat,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_2
|
||||
msgid "Propose to subscribe to the OpenERP Discovery Day on May 2010"
|
||||
msgstr ""
|
||||
msgstr "Javasolja a feliratkozást az OpenERP felfedező napra 2013 Májusában"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_3
|
||||
msgid "Thanks for subscribing to the OpenERP Discovery Day"
|
||||
msgstr ""
|
||||
msgstr "Köszönjük, hogy feliratkozott az OpenERP felfedező napra"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_7
|
||||
msgid "Propose gold partnership to silver partners"
|
||||
msgstr ""
|
||||
msgstr "Javasolja az arany partner tagságot az ezüst tagoknak"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_6
|
||||
msgid "Propose paid training to Silver partners"
|
||||
msgstr ""
|
||||
msgstr "Javasolja a költségtérítéses oktatást az Ezüst partnereknek"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_4
|
||||
@@ -139,6 +174,12 @@ msgid ""
|
||||
" If any further information required kindly revert back.\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Köszönjük az OpenERP könyv utáni érdeklődését és a "
|
||||
"vásárlását.</p>\n"
|
||||
" Ha további információra van szüksége kérjük forduljon hozzánk "
|
||||
"bizalommal.\n"
|
||||
" <p>Tisztelettel,OpenERP csapata,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_7
|
||||
@@ -150,11 +191,17 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Nagyon jó ajánlatunk van ami illeszkedhet az Ön igényeihez.\n"
|
||||
" Az Ezüst partnereinknek, Arany tagságot ajánlunk.</p>\n"
|
||||
" <p>Ha további információra van szükségük, kérjük válaszoljon "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapata,</p>"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,subject:marketing_campaign_crm_demo.email_template_5
|
||||
msgid "Propose a free technical training to Gold partners"
|
||||
msgstr ""
|
||||
msgstr "Ajánljon ingyenes műszaki oktatást az Arany partnereknek"
|
||||
|
||||
#. module: marketing_campaign_crm_demo
|
||||
#: model:email.template,body_html:marketing_campaign_crm_demo.email_template_1
|
||||
@@ -166,3 +213,8 @@ msgid ""
|
||||
"reply to this message.</p>\n"
|
||||
" <p>Regards,OpenERP Team,</p>"
|
||||
msgstr ""
|
||||
"<p>Hello,</p>\n"
|
||||
" <p>Köszönjük az OpenERP iránti őszinte érdeklődését.</p>\n"
|
||||
" <p>Ha további információra van szükségük, kérjük válaszoljon "
|
||||
"erre az üzenetre.</p>\n"
|
||||
" <p>Tisztelettel,OpenERP csapata,</p>"
|
||||
|
||||
@@ -31,19 +31,18 @@
|
||||
I'm Opening that Invoice which is created for "Seagate".
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
from openerp import netsvc
|
||||
from openerp.tools.translate import _
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
partner_pool = self.pool.get('res.partner')
|
||||
membership_line_pool = self.pool.get('membership.membership_line')
|
||||
membership_pool = self.pool.get('product.product')
|
||||
from openerp.tools.translate import _
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
partner_pool = self.pool.get('res.partner')
|
||||
membership_line_pool = self.pool.get('membership.membership_line')
|
||||
membership_pool = self.pool.get('product.product')
|
||||
|
||||
membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('base.res_partner_19'))])
|
||||
membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids)
|
||||
assert membership_lines, _('Membership is not registrated.')
|
||||
membership_line = membership_lines[0]
|
||||
invoice_pool.signal_invoice_open(cr, uid, [membership_line.account_invoice_id.id])
|
||||
|
||||
membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('base.res_partner_19'))])
|
||||
membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids)
|
||||
assert membership_lines, _('Membership is not registrated.')
|
||||
membership_line = membership_lines[0]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.invoice', membership_line.account_invoice_id.id, 'invoice_open', cr)
|
||||
- |
|
||||
I'm checking "Current membership state" of "Seagate". It is an "Invoiced Member" or not.
|
||||
-
|
||||
|
||||
+3
-7
@@ -27,7 +27,6 @@ from openerp.osv import fields, osv
|
||||
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP
|
||||
from openerp.tools import float_compare
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
from openerp import tools
|
||||
|
||||
#----------------------------------------------------------
|
||||
@@ -775,8 +774,7 @@ class mrp_production(osv.osv):
|
||||
for new_parent_id in new_parent_ids:
|
||||
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
|
||||
self.signal_button_produce_done(cr, uid, [production_id])
|
||||
return True
|
||||
|
||||
def _costs_generate(self, cr, uid, production):
|
||||
@@ -844,7 +842,6 @@ class mrp_production(osv.osv):
|
||||
return True
|
||||
|
||||
def _make_production_line_procurement(self, cr, uid, production_line, shipment_move_id, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
procurement_order = self.pool.get('procurement.order')
|
||||
production = production_line.production_id
|
||||
location_id = production.location_src_id.id
|
||||
@@ -864,7 +861,7 @@ class mrp_production(osv.osv):
|
||||
'move_id': shipment_move_id,
|
||||
'company_id': production.company_id.id,
|
||||
})
|
||||
wf_service.trg_validate(uid, procurement_order._name, procurement_id, 'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [procurement_id])
|
||||
return procurement_id
|
||||
|
||||
def _make_production_internal_shipment_line(self, cr, uid, production_line, shipment_id, parent_move_id, destination_location_id=False, context=None):
|
||||
@@ -977,7 +974,6 @@ class mrp_production(osv.osv):
|
||||
@return: Newly generated Shipment Id.
|
||||
"""
|
||||
shipment_id = False
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
uncompute_ids = filter(lambda x:x, [not x.product_lines and x.id or False for x in self.browse(cr, uid, ids, context=context)])
|
||||
self.action_compute(cr, uid, uncompute_ids, context=context)
|
||||
for production in self.browse(cr, uid, ids, context=context):
|
||||
@@ -995,7 +991,7 @@ class mrp_production(osv.osv):
|
||||
destination_location_id=source_location_id, context=context)
|
||||
self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
|
||||
|
||||
wf_service.trg_validate(uid, 'stock.picking', shipment_id, 'button_confirm', cr)
|
||||
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [shipment_id])
|
||||
production.write({'state':'confirmed'}, context=context)
|
||||
return shipment_id
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ from dateutil.relativedelta import relativedelta
|
||||
from openerp.osv import fields
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = 'procurement.order'
|
||||
@@ -87,7 +86,6 @@ class procurement_order(osv.osv):
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
|
||||
production_obj = self.pool.get('mrp.production')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
for procurement in procurement_obj.browse(cr, uid, ids, context=context):
|
||||
res_id = procurement.move_id.id
|
||||
@@ -112,7 +110,7 @@ class procurement_order(osv.osv):
|
||||
self.write(cr, uid, [procurement.id], {'state': 'running', 'production_id': produce_id})
|
||||
bom_result = production_obj.action_compute(cr, uid,
|
||||
[produce_id], properties=[x.id for x in procurement.property_ids])
|
||||
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
|
||||
production_obj.signal_button_confirm(cr, uid, [produce_id])
|
||||
if res_id:
|
||||
move_obj.write(cr, uid, [res_id],
|
||||
{'location_id': procurement.location_id.id})
|
||||
|
||||
+7
-10
@@ -21,7 +21,6 @@
|
||||
|
||||
from openerp.osv import fields
|
||||
from openerp.osv import osv
|
||||
from openerp import netsvc
|
||||
|
||||
|
||||
class StockMove(osv.osv):
|
||||
@@ -45,7 +44,6 @@ class StockMove(osv.osv):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
product_obj = self.pool.get('product.product')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
processed_ids = [move.id]
|
||||
if move.product_id.supply_method == 'produce' and move.product_id.procure_method == 'make_to_order':
|
||||
bis = bom_obj.search(cr, uid, [
|
||||
@@ -90,16 +88,17 @@ class StockMove(osv.osv):
|
||||
'procure_method': prodobj.procure_method,
|
||||
'move_id': mid,
|
||||
})
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
procurement_obj.signal_button_confirm(cr, uid, [proc_id])
|
||||
|
||||
move_obj.write(cr, uid, [move.id], {
|
||||
'location_dest_id': move.location_id.id, # dummy move for the kit
|
||||
'auto_validate': True,
|
||||
'picking_id': False,
|
||||
'state': 'confirmed'
|
||||
})
|
||||
for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context):
|
||||
wf_service.trg_validate(uid, 'procurement.order', m, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr)
|
||||
procurement_ids = procurement_obj.search(cr, uid, [('move_id','=',move.id)], context)
|
||||
procurement_obj.signal_button_confirm(cr, uid, procurement_ids)
|
||||
procurement_obj.signal_button_wait_done(cr, uid, procurement_ids)
|
||||
return processed_ids
|
||||
|
||||
def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
|
||||
@@ -110,7 +109,6 @@ class StockMove(osv.osv):
|
||||
"""
|
||||
res = []
|
||||
production_obj = self.pool.get('mrp.production')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for move in self.browse(cr, uid, ids):
|
||||
move.action_confirm(context)
|
||||
new_moves = super(StockMove, self).action_consume(cr, uid, [move.id], product_qty, location_id, context=context)
|
||||
@@ -118,7 +116,7 @@ class StockMove(osv.osv):
|
||||
for prod in production_obj.browse(cr, uid, production_ids, context=context):
|
||||
if prod.state == 'confirmed':
|
||||
production_obj.force_production(cr, uid, [prod.id])
|
||||
wf_service.trg_validate(uid, 'mrp.production', prod.id, 'button_produce', cr)
|
||||
production_obj.signal_button_produce(cr, uid, production_ids)
|
||||
for new_move in new_moves:
|
||||
if new_move == move.id:
|
||||
#This move is already there in move lines of production order
|
||||
@@ -135,14 +133,13 @@ class StockMove(osv.osv):
|
||||
"""
|
||||
res = []
|
||||
production_obj = self.pool.get('mrp.production')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context)
|
||||
#If we are not scrapping our whole move, tracking and lot references must not be removed
|
||||
#self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
|
||||
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
|
||||
for prod_id in production_ids:
|
||||
wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)
|
||||
production_obj.signal_button_produce(cr, uid, [prod_id])
|
||||
for new_move in new_moves:
|
||||
production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
|
||||
res.append(new_move)
|
||||
|
||||
@@ -118,16 +118,15 @@ class mrp_production_workcenter_line(osv.osv):
|
||||
@param action: Action to perform.
|
||||
@return: Nothing
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
prod_obj_pool = self.pool.get('mrp.production')
|
||||
oper_obj = self.browse(cr, uid, ids)[0]
|
||||
prod_obj = oper_obj.production_id
|
||||
if action == 'start':
|
||||
if prod_obj.state =='confirmed':
|
||||
prod_obj_pool.force_production(cr, uid, [prod_obj.id])
|
||||
wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
|
||||
prod_obj_pool.signal_button_produce(cr, uid, [prod_obj.id])
|
||||
elif prod_obj.state =='ready':
|
||||
wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
|
||||
prod_obj_pool.signal_button_produce(cr, uid, [prod_obj.id])
|
||||
elif prod_obj.state =='in_production':
|
||||
return
|
||||
else:
|
||||
@@ -143,7 +142,7 @@ class mrp_production_workcenter_line(osv.osv):
|
||||
for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
|
||||
if production.move_lines or production.move_created_ids:
|
||||
prod_obj_pool.action_produce(cr,uid, production.id, production.product_qty, 'consume_produce', context = None)
|
||||
wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)
|
||||
prod_obj_pool.signal_button_produce_done(cr, uid, [oper_obj.production_id.id])
|
||||
return
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None, update=True):
|
||||
@@ -228,23 +227,21 @@ class mrp_production(osv.osv):
|
||||
@return: Super method
|
||||
"""
|
||||
obj = self.browse(cr, uid, ids)[0]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
workcenter_pool = self.pool.get('mrp.production.workcenter.line')
|
||||
for workcenter_line in obj.workcenter_lines:
|
||||
if workcenter_line.state == 'draft':
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr)
|
||||
workcenter_pool.signal_button_start_working(cr, uid, [workcenter_line.id])
|
||||
workcenter_pool.signal_button_done(cr, uid, [workcenter_line.id])
|
||||
return super(mrp_production,self).action_production_end(cr, uid, ids)
|
||||
|
||||
def action_in_production(self, cr, uid, ids):
|
||||
""" Changes state to In Production and writes starting date.
|
||||
@return: True
|
||||
"""
|
||||
obj = self.browse(cr, uid, ids)[0]
|
||||
workcenter_pool = self.pool.get('mrp.production.workcenter.line')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for prod in self.browse(cr, uid, ids):
|
||||
if prod.workcenter_lines:
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', prod.workcenter_lines[0].id, 'button_start_working', cr)
|
||||
workcenter_pool.signal_button_start_working(cr, uid, [prod.workcenter_lines[0].id])
|
||||
return super(mrp_production,self).action_in_production(cr, uid, ids)
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
@@ -252,9 +249,8 @@ class mrp_production(osv.osv):
|
||||
@return: Super method
|
||||
"""
|
||||
obj = self.browse(cr, uid, ids,context=context)[0]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for workcenter_line in obj.workcenter_lines:
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_cancel', cr)
|
||||
workcenter_pool.signal_button_cancel(cr, uid, [workcenter_line.id])
|
||||
return super(mrp_production,self).action_cancel(cr,uid,ids,context=context)
|
||||
|
||||
def _compute_planned_workcenter(self, cr, uid, ids, context=None, mini=False):
|
||||
@@ -503,35 +499,34 @@ class mrp_operations_operation(osv.osv):
|
||||
return super(mrp_operations_operation, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
workcenter_pool = self.pool.get('mrp.production.workcenter.line')
|
||||
code_ids=self.pool.get('mrp_operations.operation.code').search(cr,uid,[('id','=',vals['code_id'])])
|
||||
code=self.pool.get('mrp_operations.operation.code').browse(cr, uid, code_ids, context=context)[0]
|
||||
wc_op_id=self.pool.get('mrp.production.workcenter.line').search(cr,uid,[('workcenter_id','=',vals['workcenter_id']),('production_id','=',vals['production_id'])])
|
||||
wc_op_id=workcenter_pool.search(cr,uid,[('workcenter_id','=',vals['workcenter_id']),('production_id','=',vals['production_id'])])
|
||||
if code.start_stop in ('start','done','pause','cancel','resume'):
|
||||
if not wc_op_id:
|
||||
production_obj=self.pool.get('mrp.production').browse(cr, uid, vals['production_id'], context=context)
|
||||
wc_op_id.append(self.pool.get('mrp.production.workcenter.line').create(cr,uid,{'production_id':vals['production_id'],'name':production_obj.product_id.name,'workcenter_id':vals['workcenter_id']}))
|
||||
wc_op_id.append(workcenter_pool.create(cr,uid,{'production_id':vals['production_id'],'name':production_obj.product_id.name,'workcenter_id':vals['workcenter_id']}))
|
||||
if code.start_stop=='start':
|
||||
self.pool.get('mrp.production.workcenter.line').action_start_working(cr,uid,wc_op_id)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_start_working', cr)
|
||||
|
||||
workcenter_pool.action_start_working(cr,uid,wc_op_id)
|
||||
workcenter_pool.signal_button_start_working(cr, uid, [wc_op_id[0]])
|
||||
|
||||
if code.start_stop=='done':
|
||||
self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,wc_op_id)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_done', cr)
|
||||
workcenter_pool.action_done(cr,uid,wc_op_id)
|
||||
workcenter_pool.signal_button_done(cr, uid, [wc_op_id[0]])
|
||||
self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finished':datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
|
||||
|
||||
if code.start_stop=='pause':
|
||||
self.pool.get('mrp.production.workcenter.line').action_pause(cr,uid,wc_op_id)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_pause', cr)
|
||||
workcenter_pool.action_pause(cr,uid,wc_op_id)
|
||||
workcenter_pool.signal_button_pause(cr, uid, [wc_op_id[0]])
|
||||
|
||||
if code.start_stop=='resume':
|
||||
self.pool.get('mrp.production.workcenter.line').action_resume(cr,uid,wc_op_id)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_resume', cr)
|
||||
workcenter_pool.action_resume(cr,uid,wc_op_id)
|
||||
workcenter_pool.signal_button_resume(cr, uid, [wc_op_id[0]])
|
||||
|
||||
if code.start_stop=='cancel':
|
||||
self.pool.get('mrp.production.workcenter.line').action_cancel(cr,uid,wc_op_id)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_cancel', cr)
|
||||
workcenter_pool.action_cancel(cr,uid,wc_op_id)
|
||||
workcenter_pool.signal_button_cancel(cr, uid, [wc_op_id[0]])
|
||||
|
||||
if not self.check_operation(cr, uid, vals):
|
||||
return
|
||||
@@ -549,10 +544,9 @@ class mrp_operations_operation(osv.osv):
|
||||
return super(mrp_operations_operation, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def initialize_workflow_instance(self, cr, uid, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
line_ids = self.pool.get('mrp.production.workcenter.line').search(cr, uid, [], context=context)
|
||||
for line_id in line_ids:
|
||||
wf_service.trg_create(uid, 'mrp.production.workcenter.line', line_id, cr)
|
||||
mrp_production_workcenter_line = self.pool.get('mrp.production.workcenter.line')
|
||||
line_ids = mrp_production_workcenter_line.search(cr, uid, [], context=context)
|
||||
mrp_production_workcenter_line.create_workflow(cr, uid, line_ids)
|
||||
return True
|
||||
|
||||
_columns={
|
||||
|
||||
@@ -39,62 +39,48 @@
|
||||
Production start on first work center, so I start work operation on first work center.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_start_working', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_start_working(cr, uid, [order.workcenter_lines[0].id])
|
||||
-
|
||||
Now I pause first work operation due to technical fault of work center.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_pause', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_pause(cr, uid, [order.workcenter_lines[0].id])
|
||||
-
|
||||
I resume first work operation.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_resume', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_resume(cr, uid, [order.workcenter_lines[0].id])
|
||||
|
||||
-
|
||||
I cancel first work operation.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_cancel', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_cancel(cr, uid, [order.workcenter_lines[0].id])
|
||||
-
|
||||
I reset first work operation and start after resolving techninal fault of work center.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_draft', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_start_working', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_draft(cr, uid, [order.workcenter_lines[0].id])
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_start_working(cr, uid, [order.workcenter_lines[0].id])
|
||||
-
|
||||
I close first work operation as this work center completed its process.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_done', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_done(cr, uid, [order.workcenter_lines[0].id])
|
||||
-
|
||||
Now I close other operations one by one which are in start state.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from openerp import netsvc
|
||||
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for work_line in order.workcenter_lines[1:]:
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', work_line.id, 'button_start_working', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', work_line.id, 'button_done', cr)
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_start_working(cr, uid, [work_line.id])
|
||||
self.pool.get('mrp.production.workcenter.line').signal_button_done(cr, uid, [work_line.id])
|
||||
|
||||
-
|
||||
I check that the production order is now done.
|
||||
@@ -106,8 +92,7 @@
|
||||
I print a Barcode Report of Operation line.
|
||||
-
|
||||
!python {model: mrp_operations.operation.code}: |
|
||||
import os
|
||||
from openerp import netsvc, tools
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.mrp.code.barcode').create(cr, uid, [ref('mrp_operations.mrp_op_1'),ref('mrp_operations.mrp_op_2'),ref('mrp_operations.mrp_op_3'),ref('mrp_operations.mrp_op_4'),ref('mrp_operations.mrp_op_5')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data)
|
||||
@@ -116,8 +101,7 @@
|
||||
I print Workcenter's Barcode Report.
|
||||
-
|
||||
!python {model: mrp.workcenter}: |
|
||||
import os
|
||||
from openerp import netsvc, tools
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields,osv
|
||||
from openerp import netsvc
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp.tools.translate import _
|
||||
@@ -314,9 +313,7 @@ class mrp_repair(osv.osv):
|
||||
for repair in self.browse(cr, uid, ids):
|
||||
mrp_line_obj.write(cr, uid, [l.id for l in repair.operations], {'state': 'draft'})
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_create(uid, 'mrp.repair', id, cr)
|
||||
self.create_workflow(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_confirm(self, cr, uid, ids, *args):
|
||||
@@ -505,7 +502,6 @@ class mrp_repair(osv.osv):
|
||||
"""
|
||||
res = {}
|
||||
move_obj = self.pool.get('stock.move')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
repair_line_obj = self.pool.get('mrp.repair.line')
|
||||
seq_obj = self.pool.get('ir.sequence')
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
@@ -548,7 +544,7 @@ class mrp_repair(osv.osv):
|
||||
'tracking_id': False,
|
||||
'state': 'assigned',
|
||||
})
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
|
||||
pick_obj.signal_button_confirm(cr, uid, [picking])
|
||||
self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking})
|
||||
res[repair.id] = picking
|
||||
else:
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import fields, osv
|
||||
|
||||
class make_invoice(osv.osv_memory):
|
||||
@@ -50,9 +49,7 @@ class make_invoice(osv.osv_memory):
|
||||
# We have to trigger the workflow of the given repairs, otherwise they remain 'to be invoiced'.
|
||||
# Note that the signal 'action_invoice_create' will trigger another call to the method 'action_invoice_create',
|
||||
# but that second call will not do anything, since the repairs are already invoiced.
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for repair_id in context['active_ids']:
|
||||
wf_service.trg_validate(uid, 'mrp.repair', repair_id, 'action_invoice_create', cr)
|
||||
order_obj.signal_action_invoice_create(cr, uid, context['active_ids'])
|
||||
|
||||
form_res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
|
||||
form_id = form_res and form_res[1] or False
|
||||
|
||||
@@ -27,7 +27,7 @@ import pdb
|
||||
import time
|
||||
|
||||
import openerp
|
||||
from openerp import netsvc, tools
|
||||
from openerp import tools
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
@@ -364,7 +364,7 @@ class pos_session(osv.osv):
|
||||
ids = [ids]
|
||||
|
||||
this_record = self.browse(cr, uid, ids[0], context=context)
|
||||
this_record._workflow_signal('open')
|
||||
this_record.signal_workflow('open')
|
||||
|
||||
context.update(active_id=this_record.id)
|
||||
|
||||
@@ -442,14 +442,14 @@ class pos_session(osv.osv):
|
||||
}
|
||||
|
||||
def _confirm_orders(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
pos_order_obj = self.pool.get('pos.order')
|
||||
for session in self.browse(cr, uid, ids, context=context):
|
||||
order_ids = [order.id for order in session.order_ids if order.state == 'paid']
|
||||
|
||||
move_id = self.pool.get('account.move').create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=context)
|
||||
move_id = account_move_obj.create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=context)
|
||||
|
||||
self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=context)
|
||||
pos_order_obj._create_account_move_line(cr, uid, order_ids, session, move_id, context=context)
|
||||
|
||||
for order in session.order_ids:
|
||||
if order.state not in ('paid', 'invoiced'):
|
||||
@@ -457,7 +457,7 @@ class pos_session(osv.osv):
|
||||
_('Error!'),
|
||||
_("You cannot confirm all orders of this session, because they have not the 'paid' status"))
|
||||
else:
|
||||
wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)
|
||||
pos_order_obj.signal_done(cr, uid, [order.id])
|
||||
|
||||
return True
|
||||
|
||||
@@ -519,8 +519,7 @@ class pos_order(osv.osv):
|
||||
'journal': cash_journal.id,
|
||||
}, context=context)
|
||||
order_ids.append(order_id)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'pos.order', order_id, 'paid', cr)
|
||||
self.signal_paid(cr, uid, [order_id])
|
||||
return order_ids
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
@@ -695,9 +694,8 @@ class pos_order(osv.osv):
|
||||
}, context=context)
|
||||
if line.qty < 0:
|
||||
location_id, output_id = output_id, location_id
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
|
||||
picking_obj.signal_button_confirm(cr, uid, [picking_id])
|
||||
picking_obj.force_assign(cr, uid, [picking_id], context)
|
||||
return True
|
||||
|
||||
@@ -707,7 +705,7 @@ class pos_order(osv.osv):
|
||||
"""
|
||||
stock_picking_obj = self.pool.get('stock.picking')
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
wf_service.trg_validate(uid, 'stock.picking', order.picking_id.id, 'button_cancel', cr)
|
||||
stock_picking_obj.signal_button_cancel(cr, uid, [order.picking_id.id])
|
||||
if stock_picking_obj.browse(cr, uid, order.picking_id.id, context=context).state <> 'cancel':
|
||||
raise osv.except_osv(_('Error!'), _('Unable to cancel the picking.'))
|
||||
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
|
||||
@@ -803,7 +801,6 @@ class pos_order(osv.osv):
|
||||
return self.write(cr, uid, ids, {'state':'invoiced'}, context=context)
|
||||
|
||||
def action_invoice(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
inv_ref = self.pool.get('account.invoice')
|
||||
inv_line_ref = self.pool.get('account.invoice.line')
|
||||
product_obj = self.pool.get('product.product')
|
||||
@@ -856,7 +853,7 @@ class pos_order(osv.osv):
|
||||
inv_line['invoice_line_tax_id'] = [(6, 0, [x.id for x in line.product_id.taxes_id] )]
|
||||
inv_line_ref.create(cr, uid, inv_line, context=context)
|
||||
inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
|
||||
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
|
||||
self.signal_invoice(cr, uid, [order.id])
|
||||
|
||||
if not inv_ids: return {}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import osv
|
||||
|
||||
|
||||
@@ -28,7 +27,6 @@ class pos_confirm(osv.osv_memory):
|
||||
_description = 'Post POS Journal Entries'
|
||||
|
||||
def action_confirm(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
order_obj = self.pool.get('pos.order')
|
||||
ids = order_obj.search(cr, uid, [('state','=','paid')], context=context)
|
||||
for order in order_obj.browse(cr, uid, ids, context=context):
|
||||
@@ -38,7 +36,7 @@ class pos_confirm(osv.osv_memory):
|
||||
todo = False
|
||||
break
|
||||
if todo:
|
||||
wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)
|
||||
order_obj.signal_done(cr, uid, [order.id])
|
||||
|
||||
# Check if there is orders to reconcile their invoices
|
||||
ids = order_obj.search(cr, uid, [('state','=','invoiced'),('invoice_id.state','=','open')], context=context)
|
||||
|
||||
@@ -23,7 +23,6 @@ import time
|
||||
|
||||
import pos_box_entries
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import osv, fields
|
||||
from openerp.tools.translate import _
|
||||
|
||||
@@ -67,8 +66,7 @@ class pos_make_payment(osv.osv_memory):
|
||||
order_obj.add_payment(cr, uid, active_id, data, context=context)
|
||||
|
||||
if order_obj.test_paid(cr, uid, [active_id]):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'pos.order', active_id, 'paid', cr)
|
||||
order_obj.signal_paid(cr, uid, [active_id])
|
||||
return {'type' : 'ir.actions.act_window_close' }
|
||||
##self.print_report(cr, uid, ids, context=context)
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import osv,fields
|
||||
from openerp.tools.translate import _
|
||||
import time
|
||||
@@ -104,7 +103,6 @@ class pos_return(osv.osv_memory):
|
||||
property_obj= self.pool.get("ir.property")
|
||||
uom_obj =self. pool.get('product.uom')
|
||||
statementl_obj = self.pool.get('account.bank.statement.line')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
#Todo :Need to clean the code
|
||||
if active_id:
|
||||
data = self.browse(cr, uid, ids, context=context)[0]
|
||||
@@ -157,7 +155,7 @@ class pos_return(osv.osv_memory):
|
||||
'amount': -amount,
|
||||
})
|
||||
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
picking_obj.signal_button_confirm(cr, uid, [new_picking])
|
||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||
act = {
|
||||
'domain': "[('id', 'in', ["+str(new_order)+"])]",
|
||||
@@ -200,7 +198,6 @@ class add_product(osv.osv_memory):
|
||||
date_cur=time.strftime('%Y-%m-%d')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
prod_obj=self.pool.get('product.product')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
order_obj.add_product(cr, uid, active_id, data['product_id'], data['quantity'], context=context)
|
||||
|
||||
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
|
||||
@@ -232,7 +229,7 @@ class add_product(osv.osv_memory):
|
||||
'date':date_cur
|
||||
})
|
||||
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
picking_obj.signal_button_confirm(cr, uid, [new_picking])
|
||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||
order_obj.write(cr,uid,active_id,{'picking_id':new_picking})
|
||||
|
||||
@@ -265,7 +262,6 @@ class add_product(osv.osv_memory):
|
||||
if return_id:
|
||||
data = return_boj.read(cr,uid,return_id,[])[0]
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self_data = self.browse(cr, uid, ids, context=context)[0]
|
||||
order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context)
|
||||
|
||||
@@ -306,7 +302,7 @@ class add_product(osv.osv_memory):
|
||||
'name':'%s (return)' % order_id.name,
|
||||
'date':date_cur,
|
||||
})
|
||||
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
|
||||
picking_obj.signal_button_confirm(cr, uid, [new_picking])
|
||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||
obj=order_obj.browse(cr,uid, active_ids[0])
|
||||
context.update({'return':'return'})
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from openerp import netsvc
|
||||
from openerp.osv import osv, fields
|
||||
from openerp.tools.translate import _
|
||||
|
||||
@@ -37,9 +36,8 @@ class pos_session_opening(osv.osv_memory):
|
||||
}
|
||||
|
||||
def open_existing_session_cb_close(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wizard = self.browse(cr, uid, ids[0], context=context)
|
||||
wf_service.trg_validate(uid, 'pos.session', wizard.pos_session_id.id, 'cashbox_control', cr)
|
||||
self.pool.get('pos.session').signal_cashbox_control(cr, uid, [wizard.pos_session_id.id])
|
||||
return self.open_session_cb(cr, uid, ids, context)
|
||||
|
||||
def open_session_cb(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from operator import attrgetter
|
||||
import time
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
from openerp import netsvc
|
||||
import time
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
# Procurement
|
||||
@@ -42,7 +44,6 @@ class mrp_property_group(osv.osv):
|
||||
'name': fields.char('Property Group', size=64, required=True),
|
||||
'description': fields.text('Description'),
|
||||
}
|
||||
mrp_property_group()
|
||||
|
||||
class mrp_property(osv.osv):
|
||||
"""
|
||||
@@ -59,7 +60,6 @@ class mrp_property(osv.osv):
|
||||
_defaults = {
|
||||
'composition': lambda *a: 'min',
|
||||
}
|
||||
mrp_property()
|
||||
|
||||
class StockMove(osv.osv):
|
||||
_inherit = 'stock.move'
|
||||
@@ -72,7 +72,6 @@ class StockMove(osv.osv):
|
||||
default['procurements'] = []
|
||||
return super(StockMove, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
StockMove()
|
||||
|
||||
class procurement_order(osv.osv):
|
||||
"""
|
||||
@@ -103,7 +102,7 @@ class procurement_order(osv.osv):
|
||||
readonly=True, required=True, help="If you encode manually a Procurement, you probably want to use" \
|
||||
" a make to order method."),
|
||||
'note': fields.text('Note'),
|
||||
'message': fields.char('Latest error', help="Exception occurred while computing procurement orders."),
|
||||
'message': fields.text('Latest error', help="Exception occurred while computing procurement orders."),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('cancel','Cancelled'),
|
||||
@@ -374,14 +373,13 @@ class procurement_order(osv.osv):
|
||||
self.message_post(cr, uid, [procurement.id], body=message, context=context)
|
||||
return ok
|
||||
|
||||
def _workflow_trigger(self, cr, uid, ids, trigger, context=None):
|
||||
""" Don't trigger workflow for the element specified in trigger
|
||||
"""
|
||||
wkf_op_key = 'workflow.%s.%s' % (trigger, self._name)
|
||||
def step_workflow(self, cr, uid, ids, context=None):
|
||||
""" Don't trigger workflow for the element specified in trigger """
|
||||
wkf_op_key = 'workflow.trg_write.%s' % self._name
|
||||
if context and not context.get(wkf_op_key, True):
|
||||
# make sure we don't have a trigger loop while processing triggers
|
||||
return
|
||||
return super(procurement_order,self)._workflow_trigger(cr, uid, ids, trigger, context=context)
|
||||
return super(procurement_order, self).step_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def action_produce_assign_service(self, cr, uid, ids, context=None):
|
||||
""" Changes procurement state to Running.
|
||||
@@ -468,15 +466,12 @@ class procurement_order(osv.osv):
|
||||
|
||||
class StockPicking(osv.osv):
|
||||
_inherit = 'stock.picking'
|
||||
def test_finished(self, cursor, user, ids):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
res = super(StockPicking, self).test_finished(cursor, user, ids)
|
||||
for picking in self.browse(cursor, user, ids):
|
||||
def test_finished(self, cr, uid, ids):
|
||||
res = super(StockPicking, self).test_finished(cr, uid, ids)
|
||||
for picking in self.browse(cr, uid, ids):
|
||||
for move in picking.move_lines:
|
||||
if move.state == 'done' and move.procurements:
|
||||
for procurement in move.procurements:
|
||||
wf_service.trg_validate(user, 'procurement.order',
|
||||
procurement.id, 'button_check', cursor)
|
||||
self.pool.get('procurement.order').signal_button_check(cr, uid, map(attrgetter('id'), move.procurements))
|
||||
return res
|
||||
|
||||
class stock_warehouse_orderpoint(osv.osv):
|
||||
|
||||
@@ -57,13 +57,11 @@ class procurement_order(osv.osv):
|
||||
try:
|
||||
if use_new_cursor:
|
||||
cr = pooler.get_db(use_new_cursor).cursor()
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
if not ids:
|
||||
ids = procurement_obj.search(cr, uid, [('state', '=', 'exception')], order="date_planned")
|
||||
for id in ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', id, 'button_restart', cr)
|
||||
self.signal_button_restart(cr, uid, ids)
|
||||
if use_new_cursor:
|
||||
cr.commit()
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
|
||||
@@ -78,7 +76,7 @@ class procurement_order(osv.osv):
|
||||
ids = procurement_obj.search(cr, uid, [('state', '=', 'confirmed'), ('procure_method', '=', 'make_to_order')], offset=offset, limit=500, order='priority, date_planned', context=context)
|
||||
for proc in procurement_obj.browse(cr, uid, ids, context=context):
|
||||
if maxdate >= proc.date_planned:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr)
|
||||
self.signal_button_check(cr, uid, [proc.id])
|
||||
else:
|
||||
offset += 1
|
||||
report_later += 1
|
||||
@@ -100,7 +98,7 @@ class procurement_order(osv.osv):
|
||||
ids = procurement_obj.search(cr, uid, [('state', '=', 'confirmed'), ('procure_method', '=', 'make_to_stock')], offset=offset)
|
||||
for proc in procurement_obj.browse(cr, uid, ids):
|
||||
if maxdate >= proc.date_planned:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr)
|
||||
self.signal_button_check(cr, uid, [proc.id])
|
||||
report_ids.append(proc.id)
|
||||
else:
|
||||
report_later += 1
|
||||
@@ -155,7 +153,6 @@ class procurement_order(osv.osv):
|
||||
product_obj = self.pool.get('product.product')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
warehouse_obj = self.pool.get('stock.warehouse')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
warehouse_ids = warehouse_obj.search(cr, uid, [], context=context)
|
||||
products_ids = product_obj.search(cr, uid, [('purchase_ok', '=', True)], order='id', context=context)
|
||||
@@ -178,8 +175,8 @@ class procurement_order(osv.osv):
|
||||
proc_id = proc_obj.create(cr, uid,
|
||||
self._prepare_automatic_op_procurement(cr, uid, product, warehouse, location_id, context=context),
|
||||
context=context)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr)
|
||||
self.signal_button_confirm(cr, uid, [proc_id])
|
||||
self.signal_button_check(cr, uid, [proc_id])
|
||||
return True
|
||||
|
||||
def _get_orderpoint_date_planned(self, cr, uid, orderpoint, start_date, context=None):
|
||||
@@ -225,7 +222,6 @@ class procurement_order(osv.osv):
|
||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
offset = 0
|
||||
ids = [1]
|
||||
if automatic:
|
||||
@@ -254,7 +250,7 @@ class procurement_order(osv.osv):
|
||||
to_generate = qty
|
||||
for proc_data in procure_datas:
|
||||
if to_generate >= proc_data['product_qty']:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_data['id'], 'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [proc_data['id']])
|
||||
procurement_obj.write(cr, uid, [proc_data['id']], {'origin': op.name}, context=context)
|
||||
to_generate -= proc_data['product_qty']
|
||||
if not to_generate:
|
||||
@@ -265,10 +261,8 @@ class procurement_order(osv.osv):
|
||||
proc_id = procurement_obj.create(cr, uid,
|
||||
self._prepare_orderpoint_procurement(cr, uid, op, qty, context=context),
|
||||
context=context)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||
'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||
'button_check', cr)
|
||||
self.signal_button_confirm(cr, uid, [proc_id])
|
||||
self.signal_button_check(cr, uid, [proc_id])
|
||||
orderpoint_obj.write(cr, uid, [op.id],
|
||||
{'procurement_id': proc_id}, context=context)
|
||||
offset += len(ids)
|
||||
@@ -279,6 +273,4 @@ class procurement_order(osv.osv):
|
||||
cr.close()
|
||||
return {}
|
||||
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import netsvc
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
|
||||
@@ -64,7 +63,6 @@ class make_procurement(osv.osv_memory):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context).login
|
||||
wh_obj = self.pool.get('stock.warehouse')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
for proc in self.browse(cr, uid, ids, context=context):
|
||||
@@ -78,9 +76,7 @@ class make_procurement(osv.osv_memory):
|
||||
'location_id': wh.lot_stock_id.id,
|
||||
'procure_method':'make_to_order',
|
||||
})
|
||||
|
||||
wf_service.trg_validate(uid, 'procurement.order', procure_id, 'button_confirm', cr)
|
||||
|
||||
procurement_obj.signal_button_confirm(cr, uid, [procure_id])
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'procurement', 'procurement_form_view')
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+17
-26
@@ -22,9 +22,9 @@
|
||||
import time
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from operator import attrgetter
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
from openerp import pooler
|
||||
from openerp.tools.translate import _
|
||||
import openerp.addons.decimal_precision as dp
|
||||
@@ -260,9 +260,7 @@ class purchase_order(osv.osv):
|
||||
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.'))
|
||||
|
||||
# automatically sending subflow.delete upon deletion
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in unlink_ids:
|
||||
wf_service.trg_validate(uid, 'purchase.order', id, 'purchase_cancel', cr)
|
||||
self.signal_purchase_cancel(cr, uid, unlink_ids)
|
||||
|
||||
return super(purchase_order, self).unlink(cr, uid, unlink_ids, context=context)
|
||||
|
||||
@@ -439,8 +437,7 @@ class purchase_order(osv.osv):
|
||||
This function prints the request for quotation and mark it as sent, so that we can see more easily the next step of the workflow
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'purchase.order', ids[0], 'send_rfq', cr)
|
||||
self.signal_send_rfq(cr, uid, ids)
|
||||
datas = {
|
||||
'model': 'purchase.order',
|
||||
'ids': ids,
|
||||
@@ -486,11 +483,10 @@ class purchase_order(osv.osv):
|
||||
if not len(ids):
|
||||
return False
|
||||
self.write(cr, uid, ids, {'state':'draft','shipped':0})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for p_id in ids:
|
||||
# Deleting the existing instance of workflow for PO
|
||||
wf_service.trg_delete(uid, 'purchase.order', p_id, cr)
|
||||
wf_service.trg_create(uid, 'purchase.order', p_id, cr)
|
||||
self.delete_workflow(cr, uid, [p_id]) # TODO is it necessary to interleave the calls?
|
||||
self.create_workflow(cr, uid, [p_id])
|
||||
return True
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, context=None):
|
||||
@@ -571,26 +567,24 @@ class purchase_order(osv.osv):
|
||||
return False
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for purchase in self.browse(cr, uid, ids, context=context):
|
||||
for pick in purchase.picking_ids:
|
||||
if pick.state not in ('draft','cancel'):
|
||||
raise osv.except_osv(
|
||||
_('Unable to cancel this purchase order.'),
|
||||
_('First cancel all receptions related to this purchase order.'))
|
||||
for pick in purchase.picking_ids:
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_cancel', cr)
|
||||
self.pool.get('stock.picking') \
|
||||
.signal_button_cancel(cr, uid, map(attrgetter('id'), purchase.picking_ids))
|
||||
for inv in purchase.invoice_ids:
|
||||
if inv and inv.state not in ('cancel','draft'):
|
||||
raise osv.except_osv(
|
||||
_('Unable to cancel this purchase order.'),
|
||||
_('You must first cancel all receptions related to this purchase order.'))
|
||||
if inv:
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_cancel', cr)
|
||||
self.pool.get('account.invoice') \
|
||||
.signal_invoice_cancel(cr, uid, map(attrgetter('id'), purchase.invoice_ids))
|
||||
self.write(cr,uid,ids,{'state':'cancel'})
|
||||
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'purchase.order', id, 'purchase_cancel', cr)
|
||||
self.signal_purchase_cancel(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def _prepare_order_picking(self, cr, uid, order, context=None):
|
||||
@@ -648,11 +642,11 @@ class purchase_order(osv.osv):
|
||||
will be added. A new picking will be created if omitted.
|
||||
:return: list of IDs of pickings used/created for the given order lines (usually just one)
|
||||
"""
|
||||
stock_picking = self.pool.get('stock.picking')
|
||||
if not picking_id:
|
||||
picking_id = self.pool.get('stock.picking').create(cr, uid, self._prepare_order_picking(cr, uid, order, context=context))
|
||||
picking_id = stock_picking.create(cr, uid, self._prepare_order_picking(cr, uid, order, context=context))
|
||||
todo_moves = []
|
||||
stock_move = self.pool.get('stock.move')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for order_line in order_lines:
|
||||
if not order_line.product_id:
|
||||
continue
|
||||
@@ -663,7 +657,7 @@ class purchase_order(osv.osv):
|
||||
todo_moves.append(move)
|
||||
stock_move.action_confirm(cr, uid, todo_moves)
|
||||
stock_move.force_assign(cr, uid, todo_moves)
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
stock_picking.signal_button_confirm(cr, uid, [picking_id])
|
||||
return [picking_id]
|
||||
|
||||
def action_picking_create(self, cr, uid, ids, context=None):
|
||||
@@ -714,7 +708,6 @@ class purchase_order(osv.osv):
|
||||
|
||||
"""
|
||||
#TOFIX: merged order line should be unlink
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
def make_key(br, fields):
|
||||
list_key = []
|
||||
for field in fields:
|
||||
@@ -801,8 +794,8 @@ class purchase_order(osv.osv):
|
||||
|
||||
# make triggers pointing to the old orders point to the new order
|
||||
for old_id in old_ids:
|
||||
wf_service.trg_redirect(uid, 'purchase.order', old_id, neworder_id, cr)
|
||||
wf_service.trg_validate(uid, 'purchase.order', old_id, 'purchase_cancel', cr)
|
||||
self.redirect_workflow(cr, uid, [(old_id, neworder_id)])
|
||||
self.signal_purchase_cancel(cr, uid, [old_id]) # TODO Is it necessary to interleave the calls?
|
||||
return orders_info
|
||||
|
||||
|
||||
@@ -1169,8 +1162,7 @@ class mail_mail(osv.Model):
|
||||
|
||||
def _postprocess_sent_message(self, cr, uid, mail, context=None):
|
||||
if mail.model == 'purchase.order':
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'purchase.order', mail.res_id, 'send_rfq', cr)
|
||||
self.pool.get('purchase.order').signal_send_rfq(cr, uid, [mail.res_id])
|
||||
return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context)
|
||||
|
||||
|
||||
@@ -1192,8 +1184,7 @@ class mail_compose_message(osv.Model):
|
||||
context = context or {}
|
||||
if context.get('default_model') == 'purchase.order' and context.get('default_res_id'):
|
||||
context = dict(context, mail_post_autofollow=True)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'purchase.order', context['default_res_id'], 'send_rfq', cr)
|
||||
self.pool.get('purchase.order').signal_send_rfq(cr, uid, [context['default_res_id']])
|
||||
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -59,11 +59,8 @@
|
||||
I Validate Invoice of Purchase Order.
|
||||
-
|
||||
!python {model: purchase.order}: |
|
||||
from openerp import netsvc
|
||||
invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_1")).invoice_ids]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for invoice in invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice', invoice, 'invoice_open', cr)
|
||||
self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
|
||||
-
|
||||
I check that purchase order is invoiced.
|
||||
-
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import time
|
||||
from openerp import netsvc
|
||||
|
||||
from openerp.osv import fields,osv
|
||||
from openerp.tools.translate import _
|
||||
@@ -211,8 +210,7 @@ class purchase_order(osv.osv):
|
||||
proc_ids = proc_obj.search(cr, uid, [('purchase_id', '=', order.id)])
|
||||
if proc_ids and po.state=='confirmed':
|
||||
proc_obj.write(cr, uid, proc_ids, {'purchase_id': po.id})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'purchase.order', order.id, 'purchase_cancel', cr)
|
||||
self.signal_purchase_cancel(cr, uid, [order.id])
|
||||
po.requisition_id.tender_done(context=context)
|
||||
return res
|
||||
|
||||
|
||||
@@ -69,10 +69,8 @@
|
||||
I confirmed RFQ which has best price.
|
||||
-
|
||||
!python {model: purchase.order}: |
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
purchase = self.browse(cr, uid, ref('rfq2'), context=context)
|
||||
wf_service.trg_validate(uid, 'purchase.order', purchase.id, 'purchase_confirm', cr)
|
||||
self.signal_purchase_confirm(cr, uid, [purchase.id])
|
||||
|
||||
-
|
||||
I check status of requisition after confirmed best RFQ.
|
||||
|
||||
@@ -30,21 +30,22 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
from webkit_report import WebKitParser
|
||||
import openerp.report.interface
|
||||
from openerp.report.report_sxw import rml_parse
|
||||
|
||||
from webkit_report import WebKitParser
|
||||
|
||||
def register_report(name, model, tmpl_path, parser=rml_parse):
|
||||
"""Register the report into the services"""
|
||||
name = 'report.%s' % name
|
||||
if netsvc.Service._services.get(name, False):
|
||||
service = netsvc.Service._services[name]
|
||||
if name in openerp.report.interface.report_int._reports:
|
||||
service = openerp.report.interface.report_int[name]
|
||||
if isinstance(service, WebKitParser):
|
||||
#already instantiated properly, skip it
|
||||
return
|
||||
if hasattr(service, 'parser'):
|
||||
parser = service.parser
|
||||
del netsvc.Service._services[name]
|
||||
del openerp.report.interface.report_int[name]
|
||||
WebKitParser(name, model, tmpl_path, parser=parser)
|
||||
|
||||
|
||||
|
||||
+8
-14
@@ -418,8 +418,7 @@ class sale_order(osv.osv):
|
||||
This function prints the sales order and mark it as sent, so that we can see more easily the next step of the workflow
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'sale.order', ids[0], 'quotation_sent', cr)
|
||||
self.signal_quotation_sent(cr, uid, ids)
|
||||
datas = {
|
||||
'model': 'sale.order',
|
||||
'ids': ids,
|
||||
@@ -432,12 +431,10 @@ class sale_order(osv.osv):
|
||||
view of one of the newly created invoices
|
||||
"""
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
|
||||
# create invoices through the sales orders' workflow
|
||||
inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
|
||||
for id in ids:
|
||||
wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)
|
||||
self.signal_manual_invoice(cr, uid, ids)
|
||||
inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
|
||||
# determine newly created invoices
|
||||
new_inv_ids = list(inv_ids1 - inv_ids0)
|
||||
@@ -555,10 +552,10 @@ class sale_order(osv.osv):
|
||||
return True
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
if context is None:
|
||||
context = {}
|
||||
sale_order_line_obj = self.pool.get('sale.order.line')
|
||||
account_invoice_obj = self.pool.get('account.invoice')
|
||||
for sale in self.browse(cr, uid, ids, context=context):
|
||||
for inv in sale.invoice_ids:
|
||||
if inv.state not in ('draft', 'cancel'):
|
||||
@@ -566,8 +563,7 @@ class sale_order(osv.osv):
|
||||
_('Cannot cancel this sales order!'),
|
||||
_('First cancel all invoices attached to this sales order.'))
|
||||
for r in self.read(cr, uid, ids, ['invoice_ids']):
|
||||
for inv in r['invoice_ids']:
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv, 'invoice_cancel', cr)
|
||||
account_invoice_obj.signal_invoice_cancel(cr, uid, r['invoice_ids'])
|
||||
sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
|
||||
{'state': 'cancel'})
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
@@ -575,8 +571,7 @@ class sale_order(osv.osv):
|
||||
|
||||
def action_button_confirm(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)
|
||||
self.signal_order_confirm(cr, uid, ids)
|
||||
|
||||
# redisplay the record as a sales order
|
||||
view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
|
||||
@@ -880,7 +875,7 @@ class sale_order_line(osv.osv):
|
||||
date_order = time.strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||
|
||||
result = {}
|
||||
warning_msgs = {}
|
||||
warning_msgs = ''
|
||||
product_obj = product_obj.browse(cr, uid, product, context=context_partner)
|
||||
|
||||
uom2 = False
|
||||
@@ -991,8 +986,7 @@ class mail_compose_message(osv.Model):
|
||||
context = context or {}
|
||||
if context.get('default_model') == 'sale.order' and context.get('default_res_id') and context.get('mark_so_as_sent'):
|
||||
context = dict(context, mail_post_autofollow=True)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'sale.order', context['default_res_id'], 'quotation_sent', cr)
|
||||
self.pool.get('sale.order').signal_quotation_sent(cr, uid, [context['default_res_id']])
|
||||
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -51,11 +51,10 @@
|
||||
I cancel all the invoices.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
from openerp import netsvc
|
||||
invoice_ids = self.browse(cr, uid, ref("sale_order_8")).invoice_ids
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
account_invoice_obj = self.pool.get('account.invoice')
|
||||
for invoice in invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice', invoice.id, 'invoice_cancel', cr)
|
||||
account_invoice_obj.signal_invoice_cancel(cr, uid, [invoice.id])
|
||||
-
|
||||
I check order status in "Invoice Exception" and related invoice is in cancel state.
|
||||
-
|
||||
|
||||
@@ -41,11 +41,10 @@
|
||||
I open the Invoice.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
so = self.browse(cr, uid, ref("sale_order_2"))
|
||||
account_invoice_obj = self.pool.get('account.invoice')
|
||||
for invoice in so.invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice', invoice.id, 'invoice_open', cr)
|
||||
account_invoice_obj.signal_invoice_open(cr, uid, [invoice.id])
|
||||
-
|
||||
I pay the invoice.
|
||||
-
|
||||
|
||||
@@ -80,7 +80,6 @@ class sale_order_line_make_invoice(osv.osv_memory):
|
||||
|
||||
sales_order_line_obj = self.pool.get('sale.order.line')
|
||||
sales_order_obj = self.pool.get('sale.order')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
for line in sales_order_line_obj.browse(cr, uid, context.get('active_ids', []), context=context):
|
||||
if (not line.invoiced) and (line.state not in ('draft', 'cancel')):
|
||||
if not line.order_id.id in invoices:
|
||||
@@ -103,7 +102,7 @@ class sale_order_line_make_invoice(osv.osv_memory):
|
||||
flag = False
|
||||
break
|
||||
if flag:
|
||||
wf_service.trg_validate(uid, 'sale.order', line.order_id.id, 'manual_invoice', cr)
|
||||
sales_order_obj.signal_manual_invoice(cr, uid, [line.order_id.id])
|
||||
sales_order_obj.write(cr, uid, [line.order_id.id], {'state': 'progress'})
|
||||
|
||||
if not invoices:
|
||||
|
||||
@@ -52,10 +52,8 @@ class sale_make_invoice(osv.osv_memory):
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids)[0]
|
||||
order_obj.action_invoice_create(cr, uid, context.get(('active_ids'), []), data['grouped'], date_inv = data['invoice_date'])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in context.get(('active_ids'), []):
|
||||
wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)
|
||||
|
||||
order_obj.signal_manual_invoice(cr, uid, context.get(('active_ids'), []))
|
||||
|
||||
for o in order_obj.browse(cr, uid, context.get(('active_ids'), []), context=context):
|
||||
for i in o.invoice_ids:
|
||||
newinv.append(i.id)
|
||||
|
||||
@@ -103,11 +103,8 @@
|
||||
!python {model: procurement.order}: |
|
||||
sale_order_obj = self.pool.get('sale.order')
|
||||
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
proc_ids = self.search(cr, uid, [('origin','=',so.name)])
|
||||
for proc in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order',proc,'button_check', cr)
|
||||
self.signal_button_check(cr, uid, proc_ids)
|
||||
-
|
||||
I verify that a procurement state is "running"
|
||||
-
|
||||
|
||||
@@ -23,7 +23,6 @@ from datetime import datetime, timedelta
|
||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP, float_compare
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class sale_shop(osv.osv):
|
||||
@@ -194,11 +193,11 @@ class sale_order(osv.osv):
|
||||
return res
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
if context is None:
|
||||
context = {}
|
||||
sale_order_line_obj = self.pool.get('sale.order.line')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
stock_obj = self.pool.get('stock.picking')
|
||||
for sale in self.browse(cr, uid, ids, context=context):
|
||||
for pick in sale.picking_ids:
|
||||
if pick.state not in ('draft', 'cancel'):
|
||||
@@ -209,11 +208,9 @@ class sale_order(osv.osv):
|
||||
for mov in pick.move_lines:
|
||||
proc_ids = proc_obj.search(cr, uid, [('move_id', '=', mov.id)])
|
||||
if proc_ids:
|
||||
for proc in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc, 'button_check', cr)
|
||||
proc_obj.signal_button_check(cr, uid, proc_ids)
|
||||
for r in self.read(cr, uid, ids, ['picking_ids']):
|
||||
for pick in r['picking_ids']:
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick, 'button_cancel', cr)
|
||||
stock_obj.signal_button_cancel(cr, uid, r['picking_ids'])
|
||||
return super(sale_order, self).action_cancel(cr, uid, ids, context=context)
|
||||
|
||||
def action_wait(self, cr, uid, ids, context=None):
|
||||
@@ -396,11 +393,9 @@ class sale_order(osv.osv):
|
||||
line.write({'procurement_id': proc_id})
|
||||
self.ship_recreate(cr, uid, order, line, move_id, proc_id)
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
if picking_id:
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
for proc_id in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
picking_obj.signal_button_confirm(cr, uid, [picking_id])
|
||||
procurement_obj.signal_button_confirm(cr, uid, proc_ids)
|
||||
|
||||
val = {}
|
||||
if order.state == 'shipping_except':
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
Now I cancel latest shipment.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
from openerp import netsvc
|
||||
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
|
||||
last_delivery_order_id = delivery_orders[0]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', last_delivery_order_id, 'button_cancel', cr)
|
||||
self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
|
||||
-
|
||||
I run the scheduler.
|
||||
-
|
||||
@@ -50,11 +48,9 @@
|
||||
To cancel the sale order from Invoice Exception, I have to cancel the invoice of sale order.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
from openerp import netsvc
|
||||
invoice_ids = self.browse(cr, uid, ref("sale.sale_order_8")).invoice_ids
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
first_invoice_id = invoice_ids[0]
|
||||
wf_service.trg_validate(uid, 'account.invoice', first_invoice_id.id, 'invoice_cancel', cr)
|
||||
self.pool.get('account.invoice').signal_invoice_cancel(cr, uid, [first_invoice_id.id])
|
||||
-
|
||||
I check order status in "Invoice Exception" and related invoice is in cancel state.
|
||||
-
|
||||
|
||||
@@ -132,11 +132,10 @@
|
||||
I open the Invoice.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
from openerp import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
so = self.browse(cr, uid, ref("sale.sale_order_6"))
|
||||
account_invoice_obj = self.pool.get('account.invoice')
|
||||
for invoice in so.invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice', invoice.id, 'invoice_open', cr)
|
||||
account_invoice_obj.signal_invoice_open(cr, uid, [invoice.id])
|
||||
-
|
||||
I pay the invoice
|
||||
-
|
||||
|
||||
+292
-120
File diff suppressed because it is too large
Load Diff
+44
-30
@@ -759,10 +759,9 @@ class stock_picking(osv.osv):
|
||||
""" Changes state of picking to available if all moves are confirmed.
|
||||
@return: True
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if pick.state == 'draft':
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [pick.id])
|
||||
move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed']
|
||||
if not move_ids:
|
||||
raise osv.except_osv(_('Warning!'),_('Not enough stock, unable to reserve the products.'))
|
||||
@@ -784,12 +783,10 @@ class stock_picking(osv.osv):
|
||||
""" Confirms picking directly from draft state.
|
||||
@return: True
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if not pick.move_lines:
|
||||
raise osv.except_osv(_('Error!'),_('You cannot process picking without stock moves.'))
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id,
|
||||
'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [pick.id])
|
||||
return True
|
||||
|
||||
def draft_validate(self, cr, uid, ids, context=None):
|
||||
@@ -1345,18 +1342,18 @@ class stock_picking(osv.osv):
|
||||
|
||||
# At first we confirm the new picking (if necessary)
|
||||
if new_picking:
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [new_picking])
|
||||
# Then we finish the good picking
|
||||
self.write(cr, uid, [pick.id], {'backorder_id': new_picking})
|
||||
self.action_move(cr, uid, [new_picking], context=context)
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr)
|
||||
self.signal_button_done(cr, uid, [new_picking])
|
||||
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.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_order_name), context=context)
|
||||
else:
|
||||
self.action_move(cr, uid, [pick.id], context=context)
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
|
||||
self.signal_button_done(cr, uid, [pick.id])
|
||||
delivered_pack_id = pick.id
|
||||
|
||||
delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
|
||||
@@ -2037,7 +2034,6 @@ class stock_move(osv.osv):
|
||||
res_obj = self.pool.get('res.company')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
new_moves = []
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -2073,7 +2069,7 @@ class stock_move(osv.osv):
|
||||
})
|
||||
new_moves.append(self.browse(cr, uid, [new_id])[0])
|
||||
if pickid:
|
||||
wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_confirm', cr)
|
||||
self.signal_button_confirm(cr, uid, [pickid])
|
||||
if new_moves:
|
||||
new_moves += self.create_chained_picking(cr, uid, new_moves, context)
|
||||
return new_moves
|
||||
@@ -2195,6 +2191,7 @@ class stock_move(osv.osv):
|
||||
return True
|
||||
if context is None:
|
||||
context = {}
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
pickings = set()
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
if move.state in ('confirmed', 'waiting', 'assigned', 'draft'):
|
||||
@@ -2203,7 +2200,6 @@ class stock_move(osv.osv):
|
||||
if move.move_dest_id and move.move_dest_id.state == 'waiting':
|
||||
self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'})
|
||||
if context.get('call_unlink',False) and move.move_dest_id.picking_id:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
|
||||
self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False})
|
||||
if not context.get('call_unlink',False):
|
||||
@@ -2211,7 +2207,6 @@ class stock_move(osv.osv):
|
||||
if all(move.state == 'cancel' for move in pick.move_lines):
|
||||
self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'})
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_trigger(uid, 'stock.move', id, cr)
|
||||
return True
|
||||
@@ -2633,7 +2628,6 @@ class stock_move(osv.osv):
|
||||
product_obj = self.pool.get('product.product')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -2734,7 +2728,7 @@ class stock_move(osv.osv):
|
||||
res = cr.fetchall()
|
||||
if len(res) == len(move.picking_id.move_lines):
|
||||
picking_obj.action_move(cr, uid, [move.picking_id.id])
|
||||
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
|
||||
picking_obj.signal_button_done(cr, uid, [move.picking_id.id])
|
||||
|
||||
return [move.id for move in complete]
|
||||
|
||||
@@ -2953,15 +2947,25 @@ class stock_picking_in(osv.osv):
|
||||
#override in order to redirect the check of acces rules on the stock.picking object
|
||||
return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context)
|
||||
|
||||
def _workflow_trigger(self, cr, uid, ids, trigger, context=None):
|
||||
#override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation
|
||||
#instead of it's own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context)
|
||||
def create_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').create_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def _workflow_signal(self, cr, uid, ids, signal, context=None):
|
||||
#override in order to fire the workflow signal on given stock.picking workflow instance
|
||||
#instead of it's own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context)
|
||||
def delete_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').delete_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def step_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').step_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def signal_workflow(self, cr, uid, ids, signal, context=None):
|
||||
# overridden in order to fire the workflow signal on given stock.picking workflow instance
|
||||
# instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').signal_workflow(cr, uid, ids, signal, context=context)
|
||||
|
||||
_columns = {
|
||||
'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
|
||||
@@ -2998,15 +3002,25 @@ class stock_picking_out(osv.osv):
|
||||
#override in order to redirect the check of acces rules on the stock.picking object
|
||||
return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context)
|
||||
|
||||
def _workflow_trigger(self, cr, uid, ids, trigger, context=None):
|
||||
#override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation
|
||||
#instead of it's own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context)
|
||||
def create_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').create_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def _workflow_signal(self, cr, uid, ids, signal, context=None):
|
||||
#override in order to fire the workflow signal on given stock.picking workflow instance
|
||||
#instead of it's own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context)
|
||||
def delete_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').delete_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def step_workflow(self, cr, uid, ids, context=None):
|
||||
# overridden in order to trigger the workflow of stock.picking at the end of create,
|
||||
# write and unlink operation instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').step_workflow(cr, uid, ids, context=context)
|
||||
|
||||
def signal_workflow(self, cr, uid, ids, signal, context=None):
|
||||
# overridden in order to fire the workflow signal on given stock.picking workflow instance
|
||||
# instead of its own workflow (which is not existing)
|
||||
return self.pool.get('stock.picking').signal_workflow(cr, uid, ids, signal, context=context)
|
||||
|
||||
_columns = {
|
||||
'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
|
||||
|
||||
@@ -151,7 +151,6 @@ class stock_return_picking(osv.osv_memory):
|
||||
data_obj = self.pool.get('stock.return.picking.memory')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
model_obj = self.pool.get('ir.model.data')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
pick = pick_obj.browse(cr, uid, record_id, context=context)
|
||||
data = self.read(cr, uid, ids[0], context=context)
|
||||
date_cur = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
@@ -206,7 +205,7 @@ class stock_return_picking(osv.osv_memory):
|
||||
|
||||
if set_invoice_state_to_none:
|
||||
pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'}, context=context)
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
pick_obj.signal_button_confirm(cr, uid, [new_picking])
|
||||
pick_obj.force_assign(cr, uid, [new_picking], context)
|
||||
# Update view id in context, lp:702939
|
||||
model_list = {
|
||||
|
||||
@@ -49,7 +49,6 @@ class procurement_order(osv.osv):
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
picking_obj=self.pool.get('stock.picking')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for proc in proc_obj.browse(cr, uid, ids, context=context):
|
||||
line = None
|
||||
for line in proc.product_id.flow_pull_ids:
|
||||
@@ -109,9 +108,8 @@ class procurement_order(osv.osv):
|
||||
'procure_method': line.procure_method,
|
||||
'move_id': move_id,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [picking_id])
|
||||
self.signal_button_confirm(cr, uid, [proc_id])
|
||||
if proc.move_id:
|
||||
move_obj.write(cr, uid, [proc.move_id.id],
|
||||
{'location_id':proc.location_id.id})
|
||||
@@ -119,9 +117,8 @@ class procurement_order(osv.osv):
|
||||
self.write(cr, uid, [proc.id], {'state':'running', 'message': msg})
|
||||
self.message_post(cr, uid, [proc.id], body=msg, context=context)
|
||||
# trigger direct processing (the new procurement shares the same planned date as the original one, which is already being processed)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr)
|
||||
self.signal_button_check(cr, uid, [proc_id]) # TODO is it necessary to interleave the calls?
|
||||
return False
|
||||
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
import base64
|
||||
import urllib2
|
||||
from urlparse import urlparse, urlunparse
|
||||
|
||||
import openerp
|
||||
from openerp.osv import fields, osv
|
||||
@@ -30,11 +31,12 @@ class Binary(openerp.addons.web.http.Controller):
|
||||
|
||||
@openerp.addons.web.http.jsonrequest
|
||||
def url2binary(self, req, url):
|
||||
if not url.startswith("http"):
|
||||
raise Exception("Not allowed to load a file using this protocol")
|
||||
if url.count("?") > 0 or url.count("&") > 0 or url.count("=") > 0:
|
||||
raise Exception("Not allowed to use GET parameters")
|
||||
"""Used exclusively to load images from LinkedIn profiles, must not be used for anything else."""
|
||||
req.session.assert_valid(force=True)
|
||||
_scheme, _netloc, path, params, query, fragment = urlparse(url)
|
||||
# media.linkedin.com is the master domain for LinkedIn media (replicated to CDNs),
|
||||
# so forcing it should always work and prevents abusing this method to load arbitrary URLs
|
||||
url = urlunparse(('http', 'media.linkedin.com', path, params, query, fragment))
|
||||
bfile = urllib2.urlopen(url)
|
||||
return base64.b64encode(bfile.read())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user