[MERGE]: Merge with lp:~xrg/openobject-addons/trunk-doc4-fix
bzr revid: ksa@tinyerp.co.in-20100831090148-j2j3m01ai4v6l18y
This commit is contained in:
@@ -75,7 +75,6 @@ module named account_voucher.
|
||||
'wizard/account_journal_select_view.xml',
|
||||
'wizard/account_change_currency_view.xml',
|
||||
'wizard/account_validate_move_view.xml',
|
||||
'wizard/account_pay_invoice_view.xml',
|
||||
'wizard/account_unreconcile_view.xml',
|
||||
'wizard/account_report_general_ledger_view.xml',
|
||||
'wizard/account_invoice_state_view.xml',
|
||||
|
||||
+77
-44
@@ -18,6 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
from dateutil.relativedelta import relativedelta
|
||||
@@ -60,7 +61,7 @@ class account_payment_term(osv.osv):
|
||||
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
'active': 1,
|
||||
}
|
||||
_order = "name"
|
||||
|
||||
@@ -120,9 +121,9 @@ class account_payment_term_line(osv.osv):
|
||||
'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True),
|
||||
}
|
||||
_defaults = {
|
||||
'value': lambda *a: 'balance',
|
||||
'sequence': lambda *a: 5,
|
||||
'days2': lambda *a: 0,
|
||||
'value': 'balance',
|
||||
'sequence': 5,
|
||||
'days2': 0,
|
||||
}
|
||||
_order = "sequence"
|
||||
|
||||
@@ -405,10 +406,10 @@ class account_account(osv.osv):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'type': lambda *a : 'view',
|
||||
'reconcile': lambda *a: False,
|
||||
'active': lambda *a: True,
|
||||
'currency_mode': lambda *a: 'current',
|
||||
'type': 'view',
|
||||
'reconcile': False,
|
||||
'active': True,
|
||||
'currency_mode': 'current',
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
|
||||
}
|
||||
|
||||
@@ -502,7 +503,7 @@ class account_account(osv.osv):
|
||||
default['child_parent_ids'] = False
|
||||
return super(account_account, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def _check_moves(self, cr, uid, ids, method, context):
|
||||
def _check_moves(self, cr, uid, ids, method, context=None):
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
account_ids = self.search(cr, uid, [('id', 'child_of', ids)])
|
||||
|
||||
@@ -518,7 +519,7 @@ class account_account(osv.osv):
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.'))
|
||||
return True
|
||||
|
||||
def _check_allow_type_change(self, cr, uid, ids, new_type, context):
|
||||
def _check_allow_type_change(self, cr, uid, ids, new_type, context=None):
|
||||
group1 = ['payable', 'receivable', 'other']
|
||||
group2 = ['consolidation','view']
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
@@ -548,9 +549,9 @@ class account_account(osv.osv):
|
||||
self._check_allow_type_change(cr, uid, ids, vals['type'], context=context)
|
||||
return super(account_account, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
self._check_moves(cr, uid, ids, "unlink", context)
|
||||
return super(account_account, self).unlink(cr, uid, ids, context)
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
self._check_moves(cr, uid, ids, "unlink", context=context)
|
||||
return super(account_account, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
account_account()
|
||||
|
||||
@@ -562,6 +563,7 @@ class account_journal_view(osv.osv):
|
||||
'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns')
|
||||
}
|
||||
_order = "name"
|
||||
|
||||
account_journal_view()
|
||||
|
||||
|
||||
@@ -587,6 +589,7 @@ class account_journal_column(osv.osv):
|
||||
'readonly': fields.boolean('Readonly'),
|
||||
}
|
||||
_order = "sequence"
|
||||
|
||||
account_journal_column()
|
||||
|
||||
class account_journal(osv.osv):
|
||||
@@ -614,7 +617,7 @@ class account_journal(osv.osv):
|
||||
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
|
||||
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
|
||||
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
|
||||
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
|
||||
'entry_posted': fields.boolean('Skip \'Draft\' State for Manual Entries', help='Check this box if you don\'t want new journal entries to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation. \nNote that journal entries that are automatically created by the system are always skipping that state.'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
|
||||
# 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
|
||||
# help="The sequence used for invoice numbers in this journal."),
|
||||
@@ -997,7 +1000,7 @@ class account_move(osv.osv):
|
||||
@param context: context arguments, like lang, time zone
|
||||
@param limit: Returns first 'n' ids of complete result, default is 80.
|
||||
|
||||
@return: Returns a list of tupples containing id and name
|
||||
@return: Returns a list of tuples containing id and name
|
||||
"""
|
||||
|
||||
if not args:
|
||||
@@ -1058,13 +1061,13 @@ class account_move(osv.osv):
|
||||
else:
|
||||
if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
|
||||
continue
|
||||
|
||||
|
||||
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]) ,(amount,))
|
||||
res_ids = set(id[0] for id in cr.fetchall())
|
||||
ids = ids and (ids & res_ids) or res_ids
|
||||
if ids:
|
||||
return [('id','in',tuple(ids))]
|
||||
else:
|
||||
else:
|
||||
return [('id', '=', '0')]
|
||||
|
||||
_columns = {
|
||||
@@ -1075,7 +1078,7 @@ class account_move(osv.osv):
|
||||
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State', required=True, readonly=True,
|
||||
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
|
||||
'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
|
||||
'to_check': fields.boolean('To Be Verified'),
|
||||
'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'),
|
||||
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
|
||||
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
|
||||
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
|
||||
@@ -1148,6 +1151,24 @@ class account_move(osv.osv):
|
||||
return True
|
||||
|
||||
def button_validate(self, cursor, user, ids, context=None):
|
||||
def _get_chart_account(cursor, user, account):
|
||||
if account.parent_id:
|
||||
chart_account = _get_chart_account(cursor, user, account.parent_id)
|
||||
else:
|
||||
chart_account = account
|
||||
return chart_account
|
||||
|
||||
for move in self.browse(cursor, user, ids):
|
||||
lines = move.line_id
|
||||
if lines:
|
||||
ref_line = lines[0]
|
||||
ref_chart_account = _get_chart_account(cursor, user, ref_line.account_id)
|
||||
parent_left = ref_chart_account.parent_left
|
||||
parent_right = ref_chart_account.parent_right
|
||||
result = True
|
||||
for line in lines[1:]:
|
||||
if not (line.account_id.parent_left >= parent_left and line.account_id.parent_left <= parent_right):
|
||||
raise osv.except_osv(_('Error !'), _('You cannot validate a move unless accounts in its entry lines are in same Chart Of Accounts !'))
|
||||
return self.post(cursor, user, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context={}):
|
||||
@@ -1453,7 +1474,7 @@ class account_tax_code(osv.osv):
|
||||
|
||||
This code is used for some tax declarations.
|
||||
"""
|
||||
def _sum(self, cr, uid, ids, name, args, context,where ='', where_params=()):
|
||||
def _sum(self, cr, uid, ids, name, args, context, where ='', where_params=()):
|
||||
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
|
||||
if context.get('based_on', 'invoices') == 'payments':
|
||||
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
|
||||
@@ -1466,13 +1487,15 @@ class account_tax_code(osv.osv):
|
||||
AND ((invoice.state = \'paid\') \
|
||||
OR (invoice.id IS NULL)) \
|
||||
GROUP BY line.tax_code_id',
|
||||
(parent_ids,)+where_params)
|
||||
(parent_ids,) + where_params)
|
||||
else:
|
||||
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
|
||||
FROM account_move_line AS line \
|
||||
FROM account_move_line AS line, \
|
||||
account_move AS move \
|
||||
WHERE line.tax_code_id IN %s '+where+' \
|
||||
AND move.id = line.move_id \
|
||||
GROUP BY line.tax_code_id',
|
||||
(parent_ids,)+where_params)
|
||||
(parent_ids,) + where_params)
|
||||
res=dict(cr.fetchall())
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
def _rec_get(record):
|
||||
@@ -1483,7 +1506,12 @@ class account_tax_code(osv.osv):
|
||||
res[record.id] = round(_rec_get(record), self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
|
||||
return res
|
||||
|
||||
def _sum_year(self, cr, uid, ids, name, args, context):
|
||||
def _sum_year(self, cr, uid, ids, name, args, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
move_state = ('posted', )
|
||||
if 'state' in context and context['state'] == 'all':
|
||||
move_state = ('draft', 'posted', )
|
||||
if 'fiscalyear_id' in context and context['fiscalyear_id']:
|
||||
fiscalyear_id = context['fiscalyear_id']
|
||||
else:
|
||||
@@ -1493,12 +1521,17 @@ class account_tax_code(osv.osv):
|
||||
if fiscalyear_id:
|
||||
pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids)
|
||||
if pids:
|
||||
where = ' and period_id IN %s'
|
||||
where_params = (tuple(pids),)
|
||||
where = ' AND line.period_id IN %s AND move.state IN %s '
|
||||
where_params = (tuple(pids), move_state)
|
||||
return self._sum(cr, uid, ids, name, args, context,
|
||||
where=where, where_params=where_params)
|
||||
|
||||
def _sum_period(self, cr, uid, ids, name, args, context):
|
||||
if context is None:
|
||||
context = {}
|
||||
move_state = ('posted', )
|
||||
if 'state' in context and context['state'] == 'all':
|
||||
move_state = ('draft', 'posted', )
|
||||
if 'period_id' in context and context['period_id']:
|
||||
period_id = context['period_id']
|
||||
else:
|
||||
@@ -1507,7 +1540,7 @@ class account_tax_code(osv.osv):
|
||||
return dict.fromkeys(ids, 0.0)
|
||||
period_id = period_id[0]
|
||||
return self._sum(cr, uid, ids, name, args, context,
|
||||
where=' and line.period_id=%s', where_params=(period_id,))
|
||||
where=' AND line.period_id=%s AND move.state IN %s', where_params=(period_id, move_state))
|
||||
|
||||
_name = 'account.tax.code'
|
||||
_description = 'Tax Code'
|
||||
@@ -1665,37 +1698,37 @@ class account_tax(osv.osv):
|
||||
|
||||
return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not len(ids):
|
||||
return []
|
||||
res = []
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context):
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context=context):
|
||||
name = record['description'] and record['description'] or record['name']
|
||||
res.append((record['id'],name ))
|
||||
return res
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
def _default_company(self, cr, uid, context=None):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
_defaults = {
|
||||
'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
|
||||
'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
|
||||
'applicable_type': lambda *a: 'true',
|
||||
'type': lambda *a: 'percent',
|
||||
'amount': lambda *a: 0,
|
||||
'price_include': lambda *a: 0,
|
||||
'active': lambda *a: 1,
|
||||
'type_tax_use': lambda *a: 'all',
|
||||
'sequence': lambda *a: 1,
|
||||
'tax_group': lambda *a: 'vat',
|
||||
'ref_tax_sign': lambda *a: 1,
|
||||
'ref_base_sign': lambda *a: 1,
|
||||
'tax_sign': lambda *a: 1,
|
||||
'base_sign': lambda *a: 1,
|
||||
'include_base_amount': lambda *a: False,
|
||||
'python_compute': '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
|
||||
'python_compute_inv': '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
|
||||
'applicable_type': 'true',
|
||||
'type': 'percent',
|
||||
'amount': 0,
|
||||
'price_include': 0,
|
||||
'active': 1,
|
||||
'type_tax_use': 'all',
|
||||
'sequence': 1,
|
||||
'tax_group': 'vat',
|
||||
'ref_tax_sign': 1,
|
||||
'ref_base_sign': 1,
|
||||
'tax_sign': 1,
|
||||
'base_sign': 1,
|
||||
'include_base_amount': False,
|
||||
'company_id': _default_company,
|
||||
}
|
||||
_order = 'sequence'
|
||||
|
||||
@@ -77,7 +77,7 @@ class account_cash_statement(osv.osv):
|
||||
"""
|
||||
res ={}
|
||||
for statement in self.browse(cr, uid, ids):
|
||||
amount_total=0.0
|
||||
amount_total = 0.0
|
||||
|
||||
if statement.journal_id.type not in('cash'):
|
||||
continue
|
||||
@@ -273,8 +273,6 @@ class account_cash_statement(osv.osv):
|
||||
'balance_start': balance_start
|
||||
})
|
||||
return res
|
||||
|
||||
|
||||
res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context)
|
||||
return res
|
||||
|
||||
@@ -304,7 +302,7 @@ class account_cash_statement(osv.osv):
|
||||
if statement.name and statement.name == '/':
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
|
||||
vals.update({
|
||||
'name':number
|
||||
'name': number
|
||||
})
|
||||
|
||||
cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
|
||||
@@ -498,9 +496,8 @@ class account_cash_statement(osv.osv):
|
||||
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
|
||||
else:
|
||||
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
|
||||
|
||||
if st.journal_id.entry_posted:
|
||||
account_move_obj.write(cr, uid, [move_id], {'state':'posted'})
|
||||
move_name = st.name + ' - ' + str(move.sequence)
|
||||
account_move_obj.write(cr, uid, [move_id], {'state':'posted', 'name': move_name})
|
||||
done.append(st.id)
|
||||
|
||||
vals = {
|
||||
|
||||
@@ -136,7 +136,6 @@
|
||||
<field name="state"/>
|
||||
|
||||
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -210,7 +209,6 @@
|
||||
<group col="6" colspan="4">
|
||||
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
|
||||
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
@@ -307,7 +305,6 @@
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Create" icon="terp-camera_test"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
|
||||
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="res_roles_invoice0" model="res.roles">
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
<field name="description">Assign this role to the persons that should have the rights to confirm a draft invoice.</field>
|
||||
</record>
|
||||
|
||||
<record id="wkf" model="workflow">
|
||||
<field name="name">account.invoice.basic</field>
|
||||
<field name="osv">account.invoice</field>
|
||||
|
||||
@@ -85,10 +85,6 @@
|
||||
Period
|
||||
-->
|
||||
|
||||
<record id="res_role_period" model="res.roles">
|
||||
<field eval=""""Period"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="view_account_period_form" model="ir.ui.view">
|
||||
<field name="name">account.period.form</field>
|
||||
<field name="model">account.period</field>
|
||||
@@ -449,10 +445,9 @@
|
||||
<field name="journal_id"/>
|
||||
<field name="balance_start"/>
|
||||
<field name="balance_end_real"/>
|
||||
<field name="balance_end"/>
|
||||
<field name="balance_end" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Confirm" name="button_confirm_cash" states="open" icon="terp-gtk-go-back-rtl"/>
|
||||
<button type="object" string="Confirm" name="button_confirm_bank" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -530,7 +525,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Accounting Entries">
|
||||
<page string="Journal Entries">
|
||||
<field colspan="4" name="move_line_ids" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -662,10 +657,10 @@
|
||||
<field name="model">account.move</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Accounting Entries">
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="period_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="partner_id"/>
|
||||
@@ -684,7 +679,7 @@
|
||||
<field name="model">account.move.reconcile</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Entry Reconcile">
|
||||
<form string="Journal Entry Reconcile">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="create_date" select="1"/>
|
||||
@@ -876,7 +871,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field eval="4" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('draft');black:state in ('valid')" string="Account Entry Line" editable="top" on_write="on_create_write">
|
||||
<tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items" editable="top" on_write="on_create_write">
|
||||
<field name="date"/>
|
||||
<field name="period_id"/>
|
||||
<field name="move_id"/>
|
||||
@@ -905,7 +900,7 @@
|
||||
<field name="type">form</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Entry Line">
|
||||
<form string="Journal Item">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref"/>
|
||||
@@ -985,7 +980,7 @@
|
||||
<field name="type">form</field>
|
||||
<field eval="9" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Entry Line">
|
||||
<form string="Journal Item">
|
||||
<notebook colspan="4">
|
||||
<page string="Information">
|
||||
<separator colspan="4" string="General Information"/>
|
||||
@@ -1040,16 +1035,16 @@
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_filter" model="ir.ui.view">
|
||||
<field name="name">Entry Lines</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Entry Lines">
|
||||
<search string="Search Journal Items">
|
||||
<group col='10' colspan='4'>
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Entry Lines"/>
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Entry Lines"/>
|
||||
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Entry Lines"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
|
||||
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter
|
||||
icon="terp-dolar_ok!"
|
||||
@@ -1108,7 +1103,7 @@
|
||||
/>
|
||||
|
||||
<record id="action_move_line_select" model="ir.actions.act_window">
|
||||
<field name="name">Entry Lines</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -1163,16 +1158,15 @@
|
||||
<field name="model">account.move</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Account Entry">
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="date"/>
|
||||
<field name="period_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="line_id"/>
|
||||
<field name="to_check" groups="base.group_extended"/>
|
||||
<field name="amount" sum="Total Amount"/>
|
||||
<field name="to_check" groups="base.group_extended"/>
|
||||
<field name="state"/>
|
||||
<button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
|
||||
</tree>
|
||||
@@ -1196,9 +1190,9 @@
|
||||
<field name="amount" invisible="1" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Journal Entries Lines">
|
||||
<page string="Journal Items">
|
||||
<field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
|
||||
<form string="Account Entry Line">
|
||||
<form string="Journal Item">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref"/>
|
||||
@@ -1269,7 +1263,7 @@
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Account Entry Line">
|
||||
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Journal Items">
|
||||
<field name="ref"/>
|
||||
<field name="invoice"/>
|
||||
<field name="name"/>
|
||||
@@ -1308,13 +1302,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Move">
|
||||
<group col='8' colspan='4'>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Entries"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Entries"/>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Journal Entries"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock_zoom" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="To Review"/>
|
||||
<filter icon="terp-stock_zoom" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="Journal Entries to Review"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="ref" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref" select="1"/>
|
||||
<field name="partner_id" select='1'/>
|
||||
<field name="date" select='1'/>
|
||||
</group>
|
||||
@@ -1374,7 +1368,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_move_line_search" model="ir.actions.act_window">
|
||||
<field name="name">Entry Lines</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -1461,7 +1455,7 @@
|
||||
|
||||
<act_window
|
||||
context="{'search_default_next_partner':1,'view_mode':True}"
|
||||
id="action_account_manual_reconcile" name="Entry Lines"
|
||||
id="action_account_manual_reconcile" name="Journal Items"
|
||||
res_model="account.move.line"
|
||||
view_id="view_move_line_tree"/>
|
||||
/>
|
||||
@@ -1528,7 +1522,7 @@
|
||||
<field name="model">account.model.line</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Entry Model Line" editable="bottom">
|
||||
<tree string="Journal Entry Model Line" editable="bottom">
|
||||
<field name="sequence"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
@@ -1548,7 +1542,7 @@
|
||||
<field name="model">account.model.line</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Entry Model Line">
|
||||
<form string="Journal Entry Model Line">
|
||||
<field colspan="4" name="name" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<field name="ref" select="1"/>
|
||||
@@ -1569,7 +1563,7 @@
|
||||
<field name="model">account.model</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Entry Model">
|
||||
<form string="Journal Entry Model">
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref" select="1"/>
|
||||
<field name="journal_id" select="1"/>
|
||||
@@ -1588,7 +1582,7 @@
|
||||
<field name="model">account.model</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Entry Model">
|
||||
<tree string="Journal Entry Model">
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="company_id"/>
|
||||
@@ -1784,7 +1778,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_move_line_tree1" model="ir.actions.act_window">
|
||||
<field name="name">Entry Lines</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -1798,7 +1792,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field eval="4" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('draft');black:state in ('valid')" string="Account Entry Line">
|
||||
<tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items">
|
||||
<field name="date"/>
|
||||
<field name="move_id"/>
|
||||
<field name="statement_id" string="St."/>
|
||||
@@ -1817,7 +1811,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_tax_code_line_open" model="ir.actions.act_window">
|
||||
<field name="name">Account Entry Lines</field>
|
||||
<field name="name">Journal Items</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -2427,8 +2421,8 @@
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Accounting Entries" attrs="{'invisible': [('state','!=','confirm')]}">
|
||||
<field colspan="4" name="move_line_ids" nolabel="1" string="Accounting Entries"/>
|
||||
<page string="Journal Entries" attrs="{'invisible': [('state','!=','confirm')]}">
|
||||
<field colspan="4" name="move_line_ids" nolabel="1" string="Journal Entries"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="6" colspan="4">
|
||||
|
||||
@@ -27,20 +27,20 @@
|
||||
<field name="name">Date</field>
|
||||
<field name="field">date</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col2" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="name">N. Piece</field>
|
||||
<field name="name">Journal Entry</field>
|
||||
<field name="field">move_id</field>
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col7" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="name">Name</field>
|
||||
<field name="field">name</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field eval="True" name="required"/>
|
||||
</record>
|
||||
<record id="bank_col4" model="account.journal.column">
|
||||
@@ -78,7 +78,7 @@
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="name">Ref</field>
|
||||
<field name="field">ref</field>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col23" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
@@ -93,6 +93,7 @@
|
||||
<field eval="20" name="sequence"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="account_journal_bank_view_multi" model="account.journal.view">
|
||||
<field name="name">Bank/Cash Journal (Multi-Currency) View</field>
|
||||
</record>
|
||||
@@ -101,20 +102,20 @@
|
||||
<field name="name">Date</field>
|
||||
<field name="field">date</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col2_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">N. Piece</field>
|
||||
<field name="name">Journal Entry</field>
|
||||
<field name="field">move_id</field>
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col7_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Name</field>
|
||||
<field name="field">name</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field eval="True" name="required"/>
|
||||
</record>
|
||||
<record id="bank_col4_multi" model="account.journal.column">
|
||||
@@ -164,7 +165,7 @@
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Ref</field>
|
||||
<field name="field">ref</field>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col23_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
@@ -188,39 +189,39 @@
|
||||
<field name="name">Date</field>
|
||||
<field name="field">date</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
</record>
|
||||
<record id="journal_col2" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">N. Piece</field>
|
||||
<field name="name">Journal Entry</field>
|
||||
<field name="field">move_id</field>
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
</record>
|
||||
<record id="journal_col3" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Ref</field>
|
||||
<field name="field">ref</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="journal_col5" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Partner</field>
|
||||
<field name="field">partner_id</field>
|
||||
<field eval="4" name="sequence"/>
|
||||
<field eval="5" name="sequence"/>
|
||||
</record>
|
||||
<record id="journal_col4" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Account</field>
|
||||
<field name="field">account_id</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="5" name="sequence"/>
|
||||
<field eval="6" name="sequence"/>
|
||||
</record>
|
||||
<record id="journal_col6" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Name</field>
|
||||
<field name="field">name</field>
|
||||
<field eval="6" name="sequence"/>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field eval="True" name="required"/>
|
||||
</record>
|
||||
<record id="journal_col8" model="account.journal.column">
|
||||
@@ -257,20 +258,20 @@
|
||||
<field name="name">Date</field>
|
||||
<field name="field">date</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_journal_col2" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="name">N. Piece</field>
|
||||
<field name="name">Journal Entry</field>
|
||||
<field name="field">move_id</field>
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_journal_col3" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="name">Ref</field>
|
||||
<field name="field">ref</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_journal_col4" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
@@ -355,20 +356,20 @@
|
||||
<field name="name">Date</field>
|
||||
<field name="field">date</field>
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_refund_journal_col2" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
<field name="name">N. Piece</field>
|
||||
<field name="name">Journal Entry</field>
|
||||
<field name="field">move_id</field>
|
||||
<field eval="False" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_refund_journal_col3" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
<field name="name">Ref</field>
|
||||
<field name="field">ref</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_refund_journal_col4" model="account.journal.column">
|
||||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
@@ -507,7 +508,7 @@
|
||||
<field name="name">Account Cash Statement</field>
|
||||
<field name="code">account.cash.statement</field>
|
||||
<field name="prefix">Cr. %(month)s/%(day)s/</field>
|
||||
<field eval="0" name="number_next"/>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -1497,12 +1497,13 @@ class account_invoice_tax(osv.osv):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
company_obj = self.pool.get('res.company')
|
||||
company_currency = False
|
||||
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount']
|
||||
tax_sign = 1
|
||||
if tax_amount < 0:
|
||||
tax_sign = -1
|
||||
elif tax_amount == 0:
|
||||
tax_sign = 0
|
||||
if ids:
|
||||
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount']
|
||||
if tax_amount < 0:
|
||||
tax_sign = -1
|
||||
elif tax_amount == 0:
|
||||
tax_sign = 0
|
||||
if company_id:
|
||||
company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0]
|
||||
if currency_id and company_currency:
|
||||
|
||||
@@ -121,10 +121,6 @@
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_invoice0" model="res.roles">
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_confirmstatementfromdraft0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
||||
assert acc_id.move_id, "Move not created"
|
||||
assert (not acc_id.move_id), "Move falsely created at pro-forma"
|
||||
-
|
||||
I create invoice by clicking on Create button
|
||||
-
|
||||
@@ -53,90 +53,4 @@
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
||||
assert acc_id.move_id, "Move created"
|
||||
-
|
||||
I create a record for partial payment of 1000 EUR.
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_first0}:
|
||||
amount: 1000.0
|
||||
date: '2010-05-26'
|
||||
journal_id: account.sales_journal
|
||||
name: First payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_first0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
-
|
||||
I check that the invoice state is still open
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_customer0}:
|
||||
- state == 'open'
|
||||
-
|
||||
I make second partial payment of 6000 EUR.
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_second0}:
|
||||
amount: 6000.0
|
||||
date: '2010-05-28'
|
||||
journal_id: account.sales_journal
|
||||
name: Second payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_second0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
-
|
||||
I make final partial payment of 2000 EUR
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_final0}:
|
||||
amount: 2000.0
|
||||
date: '2010-05-30'
|
||||
journal_id: account.sales_journal
|
||||
name: Final payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_final0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
|
||||
-
|
||||
I check that the invoice state is now Done
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_customer0}:
|
||||
- state == 'paid'
|
||||
-
|
||||
I check that an payment entry gets created in the account.move.line
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
||||
assert(acc_id.move_id)
|
||||
-
|
||||
I refund the invoice Using Refund Button
|
||||
-
|
||||
!record {model: account.invoice.refund, id: account_invoice_refund_0}:
|
||||
description: Refund To China Export
|
||||
period: account.period_5
|
||||
-
|
||||
I clicked on refund button
|
||||
-
|
||||
!python {model: account.invoice.refund}: |
|
||||
self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US', "tz": False, "active_model": "account.invoice", "active_ids": [ref("account.account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account.account_invoice_customer0"), })
|
||||
-
|
||||
I checked that a new entry with state "Draft" created in account move line
|
||||
|
||||
|
||||
assert acc_id.move_id, "Move not created for open invoice"
|
||||
|
||||
@@ -32,55 +32,4 @@
|
||||
I check that the invoice state is now "Open"
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_supplier0}:
|
||||
- state == 'open'
|
||||
-
|
||||
I make a partial payment of 2000 EUR
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_firstpaymenttoaxelorforbasicpc0}:
|
||||
amount: 2000.0
|
||||
date: '2010-05-29'
|
||||
journal_id: account.sales_journal
|
||||
name: First Payment to Axelor for Basic PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_firstpaymenttoaxelorforbasicpc0")],
|
||||
{"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
|
||||
25, "active_ids": [ref("account_invoice_supplier0")], "type": "in_invoice", "active_id":
|
||||
ref("account_invoice_supplier0"), })
|
||||
-
|
||||
I check that the invoice state is still "Open"
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_supplier0}:
|
||||
- state == 'open'
|
||||
-
|
||||
I make final partial payment of 1000 EUR
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_finalpaymenttoaxelorforbasicpc0}:
|
||||
amount: 1000.0
|
||||
date: '2010-06-17'
|
||||
journal_id: account.sales_journal
|
||||
name: Final Payment to Axelor for Basic PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_finalpaymenttoaxelorforbasicpc0")],
|
||||
{"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
|
||||
25, "active_ids": [ref("account_invoice_supplier0")], "type": "in_invoice", "active_id":
|
||||
ref("account_invoice_supplier0"), })
|
||||
|
||||
-
|
||||
I check that the invoice state is now "Done"
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_supplier0}:
|
||||
- state == 'paid'
|
||||
-
|
||||
I check that an payment entry gets created in the account move line
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_supplier0"))
|
||||
assert(acc_id.move_id)
|
||||
- state == 'open'
|
||||
@@ -49,9 +49,12 @@
|
||||
I clicked on validate Button
|
||||
-
|
||||
!python {model: validate.account.move}: |
|
||||
self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US",
|
||||
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")],
|
||||
"tz": False, "active_id": ref("account.menu_validate_account_moves"), })
|
||||
try:
|
||||
self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US",
|
||||
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")],
|
||||
"tz": False, "active_id": ref("account.menu_validate_account_moves"), })
|
||||
except:
|
||||
pass
|
||||
|
||||
-
|
||||
I check that the invoice state is now "Posted"
|
||||
|
||||
@@ -31,7 +31,6 @@ import account_reconcile_partner_process
|
||||
import account_reconcile
|
||||
import account_unreconcile
|
||||
import account_invoice_refund
|
||||
import account_pay_invoice
|
||||
import account_move_journal
|
||||
import account_journal_select
|
||||
import account_move_bank_reconcile
|
||||
|
||||
@@ -24,7 +24,7 @@ from tools.translate import _
|
||||
|
||||
class account_chart(osv.osv_memory):
|
||||
"""
|
||||
For Chart of Accounrs
|
||||
For Chart of Accounts
|
||||
"""
|
||||
_name = "account.chart"
|
||||
_description = "Account chart"
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
class account_invoice_pay_writeoff(osv.osv_memory):
|
||||
"""
|
||||
Opens the write off amount pay form.
|
||||
"""
|
||||
_name = "account.invoice.pay.writeoff"
|
||||
_description = "Pay Invoice "
|
||||
_columns = {
|
||||
'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', required=True),
|
||||
'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', required=True),
|
||||
'comment': fields.char('Comment', size=64, required=True),
|
||||
'analytic_id': fields.many2one('account.analytic.account','Analytic Account', domain=[('parent_id', '!=', False)])
|
||||
}
|
||||
_defaults = {
|
||||
'comment': 'Write-Off',
|
||||
}
|
||||
|
||||
def pay_and_reconcile_writeoff(self, cr, uid, ids, context=None):
|
||||
data = self.read(cr, uid, ids, context=context)[0]
|
||||
context.update({'write_off': data})
|
||||
self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context)
|
||||
return {}
|
||||
|
||||
account_invoice_pay_writeoff()
|
||||
|
||||
class account_invoice_pay(osv.osv_memory):
|
||||
"""
|
||||
Generate pay invoice wizard, user can make partial or full payment for invoice.
|
||||
"""
|
||||
_name = "account.invoice.pay"
|
||||
_description = "Pay Invoice "
|
||||
_columns = {
|
||||
'amount': fields.float('Amount paid', required=True, digits_compute = dp.get_precision('Account')),
|
||||
'name': fields.char('Entry Name', size=64, required=True),
|
||||
'date': fields.date('Date payment', required=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal/Payment Mode', required=True, domain=[('type','=','cash')]),
|
||||
'period_id': fields.many2one('account.period', 'Period', required=True),
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('active_id', False):
|
||||
invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context)
|
||||
if invoice.state in ['draft', 'proforma2', 'cancel']:
|
||||
raise osv.except_osv(_('Error !'), _('Can not pay draft/proforma/cancel invoice.'))
|
||||
pass
|
||||
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
period_id = False
|
||||
ids = self.pool.get('account.period').find(cr, uid, context=context)
|
||||
if len(ids):
|
||||
period_id = ids[0]
|
||||
return period_id
|
||||
|
||||
def _get_amount(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('active_id', False):
|
||||
return self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context).residual
|
||||
return 0.0
|
||||
|
||||
_defaults = {
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'period_id': _get_period,
|
||||
'amount': _get_amount,
|
||||
}
|
||||
|
||||
def wo_check(self, cr, uid, ids, context=None):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids,context=context)[0]
|
||||
invoice = inv_obj.browse(cr, uid, context['active_id'], context)
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
|
||||
|
||||
# Here we need that:
|
||||
# The invoice total amount in company's currency <> paid amount in company currency
|
||||
# (according to the correct day rate, invoicing rate and payment rate are may be different)
|
||||
# => Ask to a write-off of the difference. This could happen even if both amount are equal,
|
||||
# because if the currency rate
|
||||
# Get the amount in company currency for the invoice (according to move lines)
|
||||
inv_amount_company_currency = 0
|
||||
for aml in invoice.move_id.line_id:
|
||||
if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
|
||||
inv_amount_company_currency += aml.debit
|
||||
inv_amount_company_currency -= aml.credit
|
||||
inv_amount_company_currency = abs(inv_amount_company_currency)
|
||||
|
||||
# Get the current amount paid in company currency
|
||||
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
|
||||
ctx = {'date':data['date']}
|
||||
amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['amount'], round=True, context=ctx)
|
||||
else:
|
||||
amount_paid = data['amount']
|
||||
# Get the old payment if there are some
|
||||
if invoice.payment_ids:
|
||||
debit = credit = 0.0
|
||||
for payment in invoice.payment_ids:
|
||||
debit += payment.debit
|
||||
credit += payment.credit
|
||||
amount_paid += abs(debit-credit)
|
||||
|
||||
# Test if there is a difference according to currency rouding setting
|
||||
if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id,
|
||||
(amount_paid - inv_amount_company_currency)):
|
||||
return self.pay_and_reconcile(cr, uid, ids, context=context)
|
||||
else:
|
||||
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_invoice_pay_writeoff')], context=context)
|
||||
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
|
||||
return {
|
||||
'name': _('Information addendum'),
|
||||
'context': context,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.invoice.pay.writeoff',
|
||||
'views': [(resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
def pay_and_reconcile(self, cr, uid, ids, context=None):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids, context=context)[0]
|
||||
writeoff_account_id = False
|
||||
writeoff_journal_id = False
|
||||
comment = False
|
||||
|
||||
if 'write_off' in context and context['write_off'] :
|
||||
writeoff_account_id = context['write_off']['writeoff_acc_id']
|
||||
writeoff_journal_id = context['write_off']['writeoff_journal_id']
|
||||
comment = context['write_off']['comment']
|
||||
context['analytic_id'] = context['write_off']['analytic_id']
|
||||
|
||||
amount = data['amount']
|
||||
|
||||
invoice = inv_obj.browse(cr, uid, context['active_id'], context=context)
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context=context)
|
||||
# Compute the amount in company's currency, with the journal currency (which is equal to payment currency)
|
||||
# when it is needed : If payment currency (according to selected journal.currency) is <> from company currency
|
||||
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
|
||||
ctx = {'date':data['date']}
|
||||
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
|
||||
currency_id = journal.currency.id
|
||||
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
|
||||
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
|
||||
|
||||
if invoice.company_id.currency_id.id<>invoice.currency_id.id:
|
||||
ctx = {'date':data['date']}
|
||||
amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx)
|
||||
currency_id = invoice.currency_id.id
|
||||
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
|
||||
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
|
||||
|
||||
# Take the choosen date
|
||||
if comment:
|
||||
context.update({'date_p':data['date'],'comment':comment})
|
||||
else:
|
||||
context.update({'date_p':data['date'],'comment':False})
|
||||
|
||||
acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
|
||||
if not acc_id:
|
||||
raise osv.except_osv(_('Error !'), _('Your journal must have a default credit and debit account.'))
|
||||
inv_obj.pay_and_reconcile(cr, uid, [context['active_id']],
|
||||
amount, acc_id, data['period_id'], data['journal_id'], writeoff_account_id,
|
||||
data['period_id'], writeoff_journal_id, context, data['name'])
|
||||
return {}
|
||||
|
||||
account_invoice_pay()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_invoice_pay" model="ir.ui.view">
|
||||
<field name="name">account.invoice.pay.form</field>
|
||||
<field name="model">account.invoice.pay</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Pay invoice">
|
||||
<group colspan="4" >
|
||||
<field name="amount"/>
|
||||
<newline/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id" widget="selection"/>
|
||||
</group>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-execute" string="Partial Payment" name="pay_and_reconcile" type="object"/>
|
||||
<button icon="gtk-execute" string="Full Payment" name="wo_check" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_invoice_pay" model="ir.actions.act_window">
|
||||
<field name="name">Pay Invoice</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.invoice.pay</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_account_invoice_pay"/>
|
||||
<field name="context">{'record_id' : active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_invoice_pay_writeoff" model="ir.ui.view">
|
||||
<field name="name">account.invoice.pay.writeoff.form</field>
|
||||
<field name="model">account.invoice.pay.writeoff</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Information addendum">
|
||||
<group colspan="4" >
|
||||
<separator string="Write-Off Move" colspan="4"/>
|
||||
<field name="writeoff_journal_id"/>
|
||||
<field name="writeoff_acc_id" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="comment"/>
|
||||
<separator string="Analytic" colspan="4"/>
|
||||
<field name="analytic_id"/>
|
||||
</group>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-execute" string="Pay and reconcile" name="pay_and_reconcile_writeoff" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -17,7 +17,7 @@
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Sales Information">
|
||||
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, parent.partner_id)" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
|
||||
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id, 'type':type, partner_id':partner_id}" colspan="4" nolabel="1" height="180">
|
||||
<tree string="Sales Lines" editable="bottom">
|
||||
<field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
|
||||
<field name="name"/>
|
||||
|
||||
@@ -598,7 +598,7 @@ class Calendar(CalDAV, osv.osv):
|
||||
data_ids = mod_obj.search(cr, uid, line_domain, order="id", context=context)
|
||||
for data in mod_obj.browse(cr, uid, data_ids, context):
|
||||
ctx = parent and parent.context or None
|
||||
if data.recurrent_uid:
|
||||
if hasattr(data, 'recurrent_uid') and data.recurrent_uid:
|
||||
# Skip for event which is child of other event
|
||||
continue
|
||||
node = res_node_calendar('%s.ics' %data.id, parent, ctx, data, line.object_id.model, data.id)
|
||||
|
||||
@@ -25,6 +25,7 @@ from datetime import datetime, timedelta
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import time
|
||||
import logging
|
||||
|
||||
class crm_lead(crm_case, osv.osv):
|
||||
""" CRM Leads """
|
||||
@@ -178,13 +179,20 @@ class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
def create(self, cr, uid, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
try:
|
||||
data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
except ValueError:
|
||||
# Tolerate a missing shortcut. See product/product.py for similar code.
|
||||
logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','<new'))
|
||||
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
@@ -240,7 +240,7 @@ class document_file(osv.osv):
|
||||
return bro.address_id.partner_id.id
|
||||
return False
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
stor = self.pool.get('document.storage')
|
||||
unres = []
|
||||
# We have to do the unlink in 2 stages: prepare a list of actual
|
||||
@@ -250,7 +250,15 @@ class document_file(osv.osv):
|
||||
|
||||
for f in self.browse(cr, uid, ids, context):
|
||||
# TODO: update the node cache
|
||||
r = stor.prepare_unlink(cr, uid, f.parent_id.storage_id, f)
|
||||
par = f.parent_id
|
||||
storage_id = None
|
||||
while par:
|
||||
if par.storage_id:
|
||||
storage_id = par.storage_id
|
||||
break
|
||||
par = par.parent_id
|
||||
assert storage_id, "Strange, found file #%s w/o storage!" % f.id
|
||||
r = stor.prepare_unlink(cr, uid, storage_id, f)
|
||||
if r:
|
||||
unres.append(r)
|
||||
res = super(document_file, self).unlink(cr, uid, ids, context)
|
||||
|
||||
@@ -110,7 +110,7 @@ class document_directory(osv.osv):
|
||||
('no_selfparent', 'check(parent_id <> id)', 'Directory cannot be parent of itself!'),
|
||||
('dir_parented', 'check(parent_id IS NOT NULL OR storage_id IS NOT NULL)', 'Directory must have a parent or a storage')
|
||||
]
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
if not self.search(cr,uid,[('id','in',ids)]):
|
||||
ids = []
|
||||
|
||||
@@ -121,7 +121,7 @@ class node_context(object):
|
||||
if fbro.parent_id:
|
||||
parent = self.get_dir_node(cr, fbro.parent_id)
|
||||
|
||||
return node_file(fbro.name,parent,self,fbro)
|
||||
return node_file(fbro.name, parent, self, fbro)
|
||||
|
||||
|
||||
class node_descriptor(object):
|
||||
@@ -644,7 +644,7 @@ class node_dir(node_database):
|
||||
if (not self.parent) and ndir_node:
|
||||
if not dbro.parent_id:
|
||||
raise IOError(errno.EPERM, "Cannot move the root directory!")
|
||||
self.parent = self.context.get_dir_node(cr, dbro.parent_id.id)
|
||||
self.parent = self.context.get_dir_node(cr, dbro.parent_id)
|
||||
assert self.parent
|
||||
|
||||
if self.parent != ndir_node:
|
||||
@@ -1187,7 +1187,7 @@ class node_file(node_class):
|
||||
return ''
|
||||
|
||||
def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
|
||||
if ndir_node.context != self.context:
|
||||
if ndir_node and ndir_node.context != self.context:
|
||||
raise NotImplementedError("Cannot move files between contexts")
|
||||
|
||||
if (not self.check_perms(8)) and ndir_node.check_perms(2):
|
||||
@@ -1205,11 +1205,11 @@ class node_file(node_class):
|
||||
|
||||
if (not self.parent):
|
||||
# there *must* be a parent node for this one
|
||||
self.parent = self.context.get_dir_node(cr, dbro.parent_id.id)
|
||||
self.parent = self.context.get_dir_node(cr, dbro.parent_id)
|
||||
assert self.parent
|
||||
|
||||
ret = {}
|
||||
if self.parent != ndir_node:
|
||||
if ndir_node and self.parent != ndir_node:
|
||||
if not (isinstance(self.parent, node_dir) and isinstance(ndir_node, node_dir)):
|
||||
logger.debug('Cannot move file %r from %r to %r', self, self.parent, ndir_node)
|
||||
raise NotImplementedError('Cannot move files between dynamic folders')
|
||||
|
||||
@@ -74,7 +74,7 @@ class abstracted_fs(object):
|
||||
if not cr.fetchone():
|
||||
continue
|
||||
|
||||
cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to upgrade') ")
|
||||
cr.execute("SELECT id FROM ir_module_module WHERE name = 'document_ftp' AND state IN ('installed', 'to install', 'to upgrade') ")
|
||||
res = cr.fetchone()
|
||||
if res and len(res):
|
||||
self.db_name_list.append(db_name)
|
||||
@@ -287,7 +287,7 @@ class abstracted_fs(object):
|
||||
raise IOError(errno.EPERM, 'Cannot perform operation at root dir')
|
||||
dbname = p_parts[0]
|
||||
if dbname not in self.db_list():
|
||||
raise IOError(errno.ENOENT,'Invalid database path')
|
||||
raise IOError(errno.ENOENT,'Invalid database path: %s' % dbname)
|
||||
try:
|
||||
db = pooler.get_db(dbname)
|
||||
except Exception:
|
||||
|
||||
@@ -120,13 +120,23 @@
|
||||
I delete the test2.txt from the server (RPC).
|
||||
-
|
||||
!delete { model: ir.attachment, id:, search: "[('name','=','test2.txt')]" }
|
||||
-
|
||||
I also commit, because ftp would run in a different transaction.
|
||||
-
|
||||
!python {model: ir.attachment}: |
|
||||
cr.commit()
|
||||
-
|
||||
I check through FTP that test2.txt does not appear.
|
||||
-
|
||||
!python {model: ir.attachment}: |
|
||||
from document_ftp import test_easyftp as te
|
||||
import ftplib
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
|
||||
assert ftp.nlst("test2.txt") == []
|
||||
try:
|
||||
nlst_result = ftp.nlst("test2.txt")
|
||||
except ftplib.error_perm: # 550 error: 'path not exists'
|
||||
nlst_result = []
|
||||
assert "test2.txt" not in nlst_result, "Files: %r" % nlst_result
|
||||
-
|
||||
I create a "test-name.txt" file
|
||||
-
|
||||
@@ -152,7 +162,7 @@
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
|
||||
try:
|
||||
res = ftp.nlst("test-name.txt")
|
||||
assert res == []
|
||||
assert res == [], "File has not been renamed!"
|
||||
except error_perm, e:
|
||||
pass
|
||||
assert ftp.nlst("test-renamed.txt") == ['test-renamed.txt']
|
||||
@@ -178,7 +188,7 @@
|
||||
!python {model: ir.attachment}: |
|
||||
from document_ftp import test_easyftp as te
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2')
|
||||
assert ftp.nlst("test3.txt") == ['test3.txt']
|
||||
assert ftp.nlst("test3.txt") == ['test3.txt'], "File test3.txt is not there!"
|
||||
-
|
||||
I create a new folder, 'Test-Folder3', through FTP
|
||||
I try to move test3.txt to 'Test-Folder3'
|
||||
@@ -211,10 +221,10 @@
|
||||
from document_ftp import test_easyftp as te
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2')
|
||||
# TODO speed
|
||||
assert len(ftp.nlst()) > 200
|
||||
assert len(ftp.nlst()) >= 200, "We haven't managed to store 200 files!"
|
||||
-
|
||||
I read the 200 files, check speed
|
||||
# TODO
|
||||
-
|
||||
I move the 200 files to 'Test-Folder2'
|
||||
# TODO
|
||||
# TODO
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
I check at the server that the file is attached to Partner1
|
||||
-
|
||||
!assert {model: ir.attachment, id: , search: "[('name','=','pat1-dynamic.txt')]" }:
|
||||
- parent_id.name == 'Partners of Test'
|
||||
- parent_id.name == 'Documents'
|
||||
- res_model == 'res.partner'
|
||||
- res_id != False
|
||||
-
|
||||
|
||||
@@ -123,7 +123,7 @@ class email_template(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Name', size=100, required=True),
|
||||
'object_name':fields.many2one('ir.model', 'Model'),
|
||||
'object_name':fields.many2one('ir.model', 'Resource'),
|
||||
'model_int_name':fields.char('Model Internal Name', size=200,),
|
||||
'from_account':fields.many2one(
|
||||
'email_template.account',
|
||||
@@ -132,7 +132,7 @@ class email_template(osv.osv):
|
||||
'def_to':fields.char(
|
||||
'Recipient (To)',
|
||||
size=250,
|
||||
help="The default recipient of email."
|
||||
help="The Recipient of email. "
|
||||
"Placeholders can be used here."),
|
||||
'def_cc':fields.char(
|
||||
'CC',
|
||||
@@ -151,12 +151,12 @@ class email_template(osv.osv):
|
||||
" Placeholders can be used here."),
|
||||
'message_id':fields.char('Message-ID',
|
||||
size=250,
|
||||
help="The Message-ID header value, if you need to"
|
||||
"specify it, for example to automatically recognize the replies later."
|
||||
" Placeholders can be used here."),
|
||||
'track_campaign_item':fields.boolean('Track campaign items',
|
||||
help="Enable this if you want the outgoing e-mails to include a tracking"
|
||||
" marker that makes it possible to identify the replies an link them back to the campaign item"),
|
||||
help="Specify the Message-ID SMTP header to use in outgoing emails. Please note that this overrides the Resource tracking option! Placeholders can be used here."),
|
||||
'track_campaign_item':fields.boolean('Resource Tracking',
|
||||
help="Enable this is you wish to include a special \
|
||||
tracking marker in outgoing emails so you can identify replies and link \
|
||||
them back to the corresponding resource record. \
|
||||
This is useful for CRM leads for example"),
|
||||
'lang':fields.char(
|
||||
'Language',
|
||||
size=250,
|
||||
@@ -164,9 +164,9 @@ class email_template(osv.osv):
|
||||
" Placeholders can be used here. "
|
||||
"eg. ${object.partner_id.lang}"),
|
||||
'def_subject':fields.char(
|
||||
'Default Subject',
|
||||
'Subject',
|
||||
size=200,
|
||||
help="The default subject of email."
|
||||
help="The subject of email."
|
||||
" Placeholders can be used here.",
|
||||
translate=True),
|
||||
'def_body_text':fields.text(
|
||||
@@ -201,10 +201,12 @@ class email_template(osv.osv):
|
||||
'ref_ir_act_window':fields.many2one(
|
||||
'ir.actions.act_window',
|
||||
'Window Action',
|
||||
help="Action that will open this email template on Resource records",
|
||||
readonly=True),
|
||||
'ref_ir_value':fields.many2one(
|
||||
'ir.values',
|
||||
'Wizard Button',
|
||||
help="Button in the side bar of the form view of this Resource that will invoke the Window Action",
|
||||
readonly=True),
|
||||
'allowed_groups':fields.many2many(
|
||||
'res.groups',
|
||||
@@ -636,9 +638,13 @@ class email_template(osv.osv):
|
||||
'mail_type':'multipart/alternative',
|
||||
}
|
||||
|
||||
if template['message_id']:
|
||||
# use provided message_id with placeholders
|
||||
mailbox_values.update({'message_id': get_value(cursor, user, record_id, template['message_id'], template, context)})
|
||||
|
||||
if template['track_campaign_item']:
|
||||
# get appropriate message-id
|
||||
mailbox_values.update(message_id=tools.misc.generate_tracking_message_id(record_id))
|
||||
mailbox_values.update({'message_id': tools.misc.generate_tracking_message_id(record_id)})
|
||||
|
||||
if not mailbox_values['account_id']:
|
||||
raise Exception("Unable to send the mail. No account linked to the template.")
|
||||
|
||||
@@ -80,7 +80,12 @@ class email_template_account(osv.osv):
|
||||
'name': fields.char('Description',
|
||||
size=64, required=True,
|
||||
readonly=True, select=True,
|
||||
help="The description is used as the Sender name along with the provided From Email, \
|
||||
unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
|
||||
states={'draft':[('readonly', False)]}),
|
||||
'auto_delete': fields.boolean('Auto Delete', size=64, readonly=True,
|
||||
help="Permanently delete emails after sending",
|
||||
states={'draft':[('readonly', False)]}),
|
||||
'user':fields.many2one('res.users',
|
||||
'Related User', required=True,
|
||||
readonly=True, states={'draft':[('readonly', False)]}),
|
||||
@@ -189,25 +194,7 @@ class email_template_account(osv.osv):
|
||||
'Error: You are not allowed to have more than 1 account.',
|
||||
[])
|
||||
]
|
||||
|
||||
def on_change_emailid(self, cursor, user, ids, name=None, email_id=None, context=None):
|
||||
"""
|
||||
Called when the email ID field changes.
|
||||
|
||||
UI enhancement
|
||||
Writes the same email value to the smtpusername
|
||||
and incoming username
|
||||
"""
|
||||
#TODO: Check and remove the write. Is it needed?
|
||||
self.write(cursor, user, ids, {'state':'draft'}, context=context)
|
||||
return {
|
||||
'value': {
|
||||
'state': 'draft',
|
||||
'smtpuname':email_id,
|
||||
'isuser':email_id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_outgoing_server(self, cursor, user, ids, context=None):
|
||||
"""
|
||||
Returns the Out Going Connection (SMTP) object
|
||||
|
||||
@@ -18,16 +18,17 @@
|
||||
<notebook colspan="4">
|
||||
<page string="Outgoing">
|
||||
<separator string="Server Information" colspan="4" />
|
||||
<group colspan="4">
|
||||
<field name="smtpserver" select="1" colspan="2" />
|
||||
<field name="smtpport" select="2" colspan="2" />
|
||||
<field name="smtpssl" select="2" colspan="2" />
|
||||
<field name="smtptls" select="2" colspan="2" />
|
||||
<group colspan="4" col="4">
|
||||
<field name="smtpserver" select="1"/>
|
||||
<field name="smtpport" select="2" />
|
||||
<field name="smtpssl" select="2" />
|
||||
<field name="smtptls" select="2" />
|
||||
<field name="auto_delete" />
|
||||
</group>
|
||||
<button name="check_outgoing_connection" type="object" string="Test Outgoing Connection" />
|
||||
<separator string="User Information" colspan="4" />
|
||||
<group col="2" colspan="2">
|
||||
<field name="email_id" select="1" on_change="on_change_emailid(name,email_id)" colspan="2" />
|
||||
<field name="email_id" select="1" colspan="2" />
|
||||
<field name="smtppass" password="True" colspan="2" />
|
||||
<field name="company" select="2" colspan="2" />
|
||||
</group>
|
||||
@@ -72,15 +73,16 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<filter icon="terp-personal" string="My Accounts" name="my" domain="[('user','=',uid)]"/>
|
||||
<filter icon="terp-personal+" string="Personal Accounts" domain="[('company','=','no')]"/>
|
||||
<filter icon="terp-go-home" string="Company Accounts" domain="[('company','=','yes')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new" string="Draft" name="draft" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-camera_test" string="Approved" domain="[('state','=','approved')]"/>
|
||||
<filter icon="terp-emblem-important" string="Suspended" domain="[('state','=','suspended')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-home" string="Company Accounts" domain="[('company','=','yes')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user" select="1">
|
||||
<filter icon="terp-personal" help="My Accounts" name="my" domain="[('user','=',uid)]"/>
|
||||
</field>
|
||||
<field name="name" select="1"/>
|
||||
<field name="user" select="1"/>
|
||||
<field name="email_id" select="1"/>
|
||||
</search>
|
||||
</field>
|
||||
@@ -97,11 +99,25 @@
|
||||
</record>
|
||||
|
||||
<menuitem name="Configuration" parent="base.marketing_menu"
|
||||
id="base.menu_marketing_config_root" sequence="20" groups="base.group_system"/>
|
||||
<menuitem name="Emails" id="menu_email_template_configuration" parent="base.menu_marketing_config_root" />
|
||||
id="base.menu_marketing_config_root" sequence="20" groups="base.group_system"/>
|
||||
|
||||
<menuitem name="Email Template" id="menu_email_template_configuration" parent="base.menu_marketing_config_root" />
|
||||
|
||||
<menuitem name="Email Accounts" id="menu_email_template_account_all" parent="menu_email_template_configuration" action="action_email_template_account_tree_all"/>
|
||||
|
||||
<!-- Email Template account menu in Tools -->
|
||||
|
||||
<menuitem name="Tools" id="base.menu_tools" icon="STOCK_PREFERENCES" sequence="28"/>
|
||||
|
||||
<menuitem name="Configuration" parent="base.menu_tools"
|
||||
id="base.menu_lunch_survey_root" sequence="20" />
|
||||
|
||||
<menuitem name="Email Template" id="menu_email_template_config_tools"
|
||||
parent="base.menu_lunch_survey_root" />
|
||||
|
||||
<menuitem name="Email Accounts" id="menu_email_account_all_tools"
|
||||
parent="menu_email_template_config_tools" action="action_email_template_account_tree_all" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ class email_template_mailbox(osv.osv):
|
||||
|
||||
def send_this_mail(self, cr, uid, ids=None, context=None):
|
||||
result = True
|
||||
attachment_pool = self.pool.get('ir.attachment')
|
||||
for id in (ids or []):
|
||||
try:
|
||||
account_obj = self.pool.get('email_template.account')
|
||||
@@ -70,7 +71,7 @@ class email_template_mailbox(osv.osv):
|
||||
payload = {}
|
||||
if values['attachments_ids']:
|
||||
for attid in values['attachments_ids']:
|
||||
attachment = self.pool.get('ir.attachment').browse(cr, uid, attid, context)#,['datas_fname','datas'])
|
||||
attachment = attachment_pool.browse(cr, uid, attid, context)#,['datas_fname','datas'])
|
||||
payload[attachment.datas_fname] = attachment.datas
|
||||
result = account_obj.send_mail(cr, uid,
|
||||
[values['account_id'][0]],
|
||||
@@ -84,8 +85,15 @@ class email_template_mailbox(osv.osv):
|
||||
message_id=values['message_id'],
|
||||
context=context)
|
||||
if result == True:
|
||||
self.write(cr, uid, id, {'folder':'sent', 'state':'na', 'date_mail':time.strftime("%Y-%m-%d %H:%M:%S")}, context)
|
||||
self.historise(cr, uid, [id], "Email sent successfully", context)
|
||||
account = account_obj.browse(cr, uid, values['account_id'][0], context=context)
|
||||
if account.auto_delete:
|
||||
self.write(cr, uid, id, {'folder': 'trash'}, context=context)
|
||||
self.unlink(cr, uid, [id], context=context)
|
||||
# Remove attachments for this mail
|
||||
attachment_pool.unlink(cr, uid, values['attachments_ids'], context=context)
|
||||
else:
|
||||
self.write(cr, uid, id, {'folder':'sent', 'state':'na', 'date_mail':time.strftime("%Y-%m-%d %H:%M:%S")}, context)
|
||||
self.historise(cr, uid, [id], "Email sent successfully", context)
|
||||
else:
|
||||
error = result['error_msg']
|
||||
self.historise(cr, uid, [id], error, context)
|
||||
@@ -100,7 +108,7 @@ class email_template_mailbox(osv.osv):
|
||||
def historise(self, cr, uid, ids, message='', context=None):
|
||||
for id in ids:
|
||||
history = self.read(cr, uid, id, ['history'], context).get('history', '')
|
||||
self.write(cr, uid, id, {'history':history or '' + "\n" + time.strftime("%Y-%m-%d %H:%M:%S") + ": " + tools.ustr(message)}, context)
|
||||
self.write(cr, uid, id, {'history': (history or '' )+ "\n" + time.strftime("%Y-%m-%d %H:%M:%S") + ": " + tools.ustr(message)}, context)
|
||||
|
||||
_columns = {
|
||||
'email_from':fields.char(
|
||||
@@ -171,8 +179,7 @@ class email_template_mailbox(osv.osv):
|
||||
('na', 'Not Applicable'),
|
||||
('sending', 'Sending'),
|
||||
], 'Status', required=True),
|
||||
'date_mail':fields.datetime(
|
||||
'Rec/Sent Date'),
|
||||
'date_mail':fields.datetime('Rec/Sent Date', help="Date on which Email Sent or Received"),
|
||||
'history':fields.text(
|
||||
'History',
|
||||
readonly=True,
|
||||
@@ -184,6 +191,24 @@ class email_template_mailbox(osv.osv):
|
||||
'folder': lambda * a: 'outbox',
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
It just changes the folder of the item to "Trash", if it is no in Trash folder yet,
|
||||
or completely deletes it if it is already in Trash.
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
to_update = []
|
||||
to_remove = []
|
||||
for mail in self.browse(cr, uid, ids, context=context):
|
||||
if mail.folder == 'trash':
|
||||
to_remove.append(mail.id)
|
||||
else:
|
||||
to_update.append(mail.id)
|
||||
# Changes the folder to trash
|
||||
self.write(cr, uid, to_update, {'folder': 'trash'}, context=context)
|
||||
return super(email_template_mailbox, self).unlink(cr, uid, to_remove, context=context)
|
||||
|
||||
email_template_mailbox()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -28,32 +28,27 @@
|
||||
<field name="body_html" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
</notebook>
|
||||
<separator colspan="4" string="" />
|
||||
<group col="4" colspan="4">
|
||||
<field name="state" readonly="1" string="State"/>
|
||||
<button name="send_this_mail" type="object" string="Send Mail" icon="terp-mail-message-new"/>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="Attachments">
|
||||
<group col="4">
|
||||
<separator colspan="4" string="Attachments" />
|
||||
<field name="attachments_ids" colspan="4" nolabel="1" />
|
||||
</group>
|
||||
<separator colspan="4" string="Attachments" />
|
||||
<field name="attachments_ids" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
<page string="Advanced">
|
||||
<group col="4">
|
||||
<field name="account_id" colspan="2" />
|
||||
<field name="server_ref" colspan="2" />
|
||||
<field name="mail_type" colspan="2" />
|
||||
<field name="folder" colspan="2" select="2"/>
|
||||
<field name="message_id" select="2"/>
|
||||
<separator string="History" colspan="4" />
|
||||
<field name="history" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
<field name="account_id" colspan="2" />
|
||||
<field name="server_ref" colspan="2" />
|
||||
<field name="mail_type" colspan="2" />
|
||||
<field name="folder" colspan="2" select="2"/>
|
||||
<field name="message_id" select="2"/>
|
||||
<separator string="History" colspan="4" />
|
||||
<field name="history" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<separator colspan="4" string="" />
|
||||
<group col="4" colspan="4">
|
||||
<field name="state" readonly="1" />
|
||||
<button name="complete_mail" type="object" string="Download Full Mail" states="read,unread" />
|
||||
<button name="send_this_mail" type="object" string="Send Mail" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -64,12 +59,14 @@
|
||||
<field name="model">email_template.mailbox</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Drafts">
|
||||
<tree string="Mailbox" colors="blue:folder=='drafts';grey:folder=='trash'">
|
||||
<field name="subject" select="1" />
|
||||
<field name="user" />
|
||||
<field name="email_from" select="1" />
|
||||
<field name="subject" select="1" />
|
||||
<field name="attachments_ids" select="2" />
|
||||
<field name="email_to"/>
|
||||
<field name="date_mail" select="2" />
|
||||
<field name="attachments_ids" select="2" />
|
||||
<field name="folder" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -80,18 +77,24 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Mailboxes">
|
||||
<filter icon="terp-mail-message-new" string="Drafts" name="draft" domain="[('folder','=','drafts')]"/>
|
||||
<filter icon="terp-document-new" string="Drafts" name="draft" domain="[('folder','=','drafts')]"/>
|
||||
<filter icon="terp-mail-" string="Outbox" name="outbox" domain="[('folder','=','outbox')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-jump-to-ltr" string="Sent" domain="[('folder','=','sent')]"/>
|
||||
<filter icon="terp-camera_test" string="Sent" domain="[('folder','=','sent')]"/>
|
||||
<filter icon="terp-mail_delete" string="Trash" domain="[('folder','=','trash')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-stop" string="Not Applicable" domain="[('state','=','na')]"/>
|
||||
<filter icon="terp-gtk-jump-to-ltr" string="Sending" domain="[('state','=','sending')]"/>
|
||||
<filter icon="terp-personal+" string="Personal Emails" name="personal" domain="[('account_id.company','=','no')]"/>
|
||||
<filter icon="terp-go-home" string="Company Emails" name="company" domain="[('account_id.company','=','yes')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="email_from" select="1"/>
|
||||
<field name="email_to" select="1"/>
|
||||
<field name="subject" select="1"/>
|
||||
<field name="subject"/>
|
||||
<field name="email_from"/>
|
||||
<field name="user">
|
||||
<filter icon="terp-personal"
|
||||
string="My Emails" name="myemails"
|
||||
domain="[('account_id.user','=', uid)]" />
|
||||
</field>
|
||||
<newline/>
|
||||
<field name="email_to"/>
|
||||
<field name="date_mail"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -100,16 +103,27 @@
|
||||
<field name="name">Mailbox</field>
|
||||
<field name="res_model">email_template.mailbox</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_email_template_mailbox_tree" />
|
||||
<field name="context">{'group_by': [], 'search_default_draft': 1, 'search_default_outbox': 1}</field>
|
||||
<field name="context">{'group_by': [], 'search_default_outbox': 1}</field>
|
||||
<field name="search_view_id" ref="view_email_template_mailbox_search"/>
|
||||
</record>
|
||||
|
||||
<!--======================================== MENUS ========================================-->
|
||||
<menuitem name="MailBox" id="menu_email_template_mailbox_all_main2" parent="menu_email_template" />
|
||||
<menuitem name="Personal Mails" id="menu_email_template_personal_mails" parent="menu_email_template_mailbox_all_main2" action="action_email_template_mailbox"/>
|
||||
<menuitem name="Company Mails" id="menu_email_template_company_mails" parent="menu_email_template_mailbox_all_main2" action="action_email_template_mailbox"/>
|
||||
|
||||
<menuitem name="Emails"
|
||||
id="menu_email_template_personal_mails"
|
||||
parent="menu_email_template"
|
||||
action="action_email_template_mailbox" />
|
||||
|
||||
<!-- Mailbox menu in Tools -->
|
||||
<menuitem name="Email Template" id="menu_email_template_tools"
|
||||
parent="base.menu_tools" />
|
||||
|
||||
<menuitem name="Emails"
|
||||
id="menu_email_template_mails_tools"
|
||||
parent="menu_email_template_tools"
|
||||
action="action_email_template_mailbox" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record forcecreate="True" id="ir_cron_mail_scheduler_action" model="ir.cron">
|
||||
<record forcecreate="True" id="ir_cron_mail_scheduler_action" model="ir.cron">
|
||||
<field name="name">Email Template scheduler</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">hours</field>
|
||||
<field name="numbercall">12</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
<field eval="'email_template.mailbox'" name="model"/>
|
||||
<field eval="'run_mail_scheduler'" name="function"/>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Email Template PReview -->
|
||||
|
||||
<!-- Email Template Preview -->
|
||||
<record model="ir.ui.view" id="email_template_preview_form">
|
||||
<field name="name">email_template.preview.form</field>
|
||||
<field name="model">email_template.preview</field>
|
||||
@@ -67,25 +68,26 @@
|
||||
<field name="reply_to"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Email Data" colspan="2"/>
|
||||
<field name="def_subject" colspan="4" required="1" />
|
||||
<field name="use_sign" colspan="4" />
|
||||
<separator string="Options" colspan="2"/>
|
||||
<field name="lang" colspan="4" />
|
||||
<field name="use_sign" colspan="4" />
|
||||
<field name="track_campaign_item" colspan="4"/>
|
||||
</group>
|
||||
<separator colspan="3" string="Standard Body" />
|
||||
<separator colspan="1" string="Expression Builder" />
|
||||
|
||||
<notebook>
|
||||
<page string="Body (Text)">
|
||||
<field name="def_body_text" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
<page string="Body (Raw HTML)">
|
||||
<field name="def_body_html" colspan="4" nolabel="1" />
|
||||
<label string="Note: This is Raw HTML." colspan="4" />
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="4">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Email Content " />
|
||||
<field name="def_subject" colspan="4" required="1" />
|
||||
<notebook>
|
||||
<page string="Body (Text)">
|
||||
<field name="def_body_text" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
<page string="Body (Raw HTML)">
|
||||
<field name="def_body_html" colspan="4" nolabel="1" />
|
||||
<label string="Note: This is Raw HTML." colspan="4" />
|
||||
</page>
|
||||
</notebook>
|
||||
</group>
|
||||
<group col="4" colspan="2">
|
||||
<separator colspan="4" string="Expression Builder" />
|
||||
<field name="template_language"
|
||||
on_change="onchange_null_value(model_object_field,sub_model_object_field,null_value,template_language,context)" />
|
||||
<notebook>
|
||||
@@ -112,17 +114,23 @@
|
||||
</page>
|
||||
<page string="Advanced">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Actions" colspan="2"/>
|
||||
<button name="create_action" string="Create Action" type="object" colspan="2" attrs="{'invisible':[('ref_ir_act_window','!=',False), ('ref_ir_value','!=',False)]}"/>
|
||||
<field name="ref_ir_act_window"/>
|
||||
<field name="ref_ir_value"/>
|
||||
<button name="delete_action" string="Delete Action" type="object" colspan="2" attrs="{'invisible':[('ref_ir_act_window','=',False), ('ref_ir_value','=',False)]}"/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Actions" colspan="2"/>
|
||||
<button name="create_action" string="Create Action" type="object" colspan="2" attrs="{'invisible':[('ref_ir_act_window','!=',False), ('ref_ir_value','!=',False)]}"/>
|
||||
<field name="ref_ir_act_window"/>
|
||||
<field name="ref_ir_value"/>
|
||||
<button name="delete_action" string="Delete Action" type="object" colspan="2" attrs="{'invisible':[('ref_ir_act_window','=',False), ('ref_ir_value','=',False)]}"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Advanced Options" colspan="2"/>
|
||||
<field name="message_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Attachments" colspan="2"/>
|
||||
<notebook>
|
||||
<page string="Existing files">
|
||||
<field name="attachment_ids" colspan="4" nolabel="1"/>
|
||||
<field name="attachment_ids" colspan="4" nolabel="1" height="350"/>
|
||||
</page>
|
||||
<page string="Report">
|
||||
<field name="file_name" colspan="4" />
|
||||
@@ -183,9 +191,12 @@
|
||||
<field name="search_view_id" ref="view_email_template_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="E-MAIL Templates" id="menu_email_template_all"
|
||||
<menuitem name="Email Templates" id="menu_email_template_all"
|
||||
parent="menu_email_template_configuration" action="action_email_template_tree_all" />
|
||||
|
||||
<!-- Email Template menu in Tools -->
|
||||
<menuitem name="Email Templates" id="menu_email_template_all_tools"
|
||||
parent="menu_email_template_config_tools" action="action_email_template_tree_all" />
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -335,11 +335,6 @@ msgstr ""
|
||||
msgid "Send/Receive"
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_mailbox_all_main2
|
||||
msgid "MailBox"
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.actions.act_window,name:email_template.wizard_email_template_preview
|
||||
msgid "Template Preview"
|
||||
|
||||
@@ -174,8 +174,8 @@ msgstr "Approve Account"
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_all
|
||||
msgid "E-MAIL Templates"
|
||||
msgstr "E-MAIL Templates"
|
||||
msgid "Email Templates"
|
||||
msgstr "Email Templates"
|
||||
|
||||
#. module: email_template
|
||||
#: field:email_template.preview,rel_model_ref:0
|
||||
@@ -221,8 +221,8 @@ msgstr "Download Full Mail"
|
||||
|
||||
#. module: email_template
|
||||
#: help:email.template,def_to:0
|
||||
msgid "The default recipient of email.Placeholders can be used here."
|
||||
msgstr "The default recipient of email.Placeholders can be used here."
|
||||
msgid "The recipient of email.Placeholders can be used here."
|
||||
msgstr "The recipient of email.Placeholders can be used here."
|
||||
|
||||
#. module: email_template
|
||||
#: view:email_template.mailbox:0
|
||||
@@ -258,8 +258,8 @@ msgstr "Accounts"
|
||||
|
||||
#. module: email_template
|
||||
#: field:email.template,track_campaign_item:0
|
||||
msgid "Track campaign items"
|
||||
msgstr "Track campaign items"
|
||||
msgid "Resource Tracking"
|
||||
msgstr "Resource Tracking"
|
||||
|
||||
#. module: email_template
|
||||
#: view:email_template.preview:0
|
||||
@@ -335,11 +335,6 @@ msgstr "Body(Html)"
|
||||
msgid "Send/Receive"
|
||||
msgstr "Send/Receive"
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_mailbox_all_main2
|
||||
msgid "MailBox"
|
||||
msgstr "MailBox"
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.actions.act_window,name:email_template.wizard_email_template_preview
|
||||
msgid "Template Preview"
|
||||
@@ -762,8 +757,8 @@ msgstr "Save in Drafts"
|
||||
|
||||
#. module: email_template
|
||||
#: help:email.template,def_subject:0
|
||||
msgid "The default subject of email. Placeholders can be used here."
|
||||
msgstr "The default subject of email. Placeholders can be used here."
|
||||
msgid "The subject of email. Placeholders can be used here."
|
||||
msgstr "The subject of email. Placeholders can be used here."
|
||||
|
||||
#. module: email_template
|
||||
#: field:email_template.account,smtptls:0
|
||||
@@ -772,8 +767,8 @@ msgstr "TLS"
|
||||
|
||||
#. module: email_template
|
||||
#: view:email_template.send.wizard:0
|
||||
msgid "Add here all attachments of the current document you want to include in the e-mail."
|
||||
msgstr "Add here all attachments of the current document you want to include in the e-mail."
|
||||
msgid "Add here all attachments of the current document you want to include in the Email."
|
||||
msgstr "Add here all attachments of the current document you want to include in the Email."
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.model,name:email_template.model_email_template_send_wizard
|
||||
@@ -786,6 +781,8 @@ msgstr "This is the wizard for sending mail"
|
||||
#: code:addons/email_template/email_template_mailbox.py:0
|
||||
#: code:addons/email_template/wizard/email_template_send_wizard.py:0
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_config_tools
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_configuration
|
||||
#, python-format
|
||||
msgid "Email Template"
|
||||
msgstr "Email Template"
|
||||
@@ -1023,8 +1020,8 @@ msgstr "Password"
|
||||
#: help:email.template,message_id:0
|
||||
#: help:email_template.preview,message_id:0
|
||||
#: help:email_template.send.wizard,message_id:0
|
||||
msgid "The Message-ID header value, if you need tospecify it, for example to automatically recognize the replies later. Placeholders can be used here."
|
||||
msgstr "The Message-ID header value, if you need tospecify it, for example to automatically recognize the replies later. Placeholders can be used here."
|
||||
msgid "Specify the Message-ID SMTP header to use in outgoing emails. Please note that this overrides the Resource tracking option! Placeholders can be used here."
|
||||
msgstr "Specify the Message-ID SMTP header to use in outgoing emails. Please note that this overrides the Resource tracking option! Placeholders can be used here."
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_configuration
|
||||
@@ -1113,11 +1110,6 @@ msgstr "Corporate"
|
||||
msgid "Enter name of outgoing server, eg:smtp.gmail.com "
|
||||
msgstr "Enter name of outgoing server, eg:smtp.gmail.com "
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_company_mails
|
||||
msgid "Company Mails"
|
||||
msgstr "Company Mails"
|
||||
|
||||
#. module: email_template
|
||||
#: view:email.template:0
|
||||
msgid "Addresses"
|
||||
@@ -1130,8 +1122,8 @@ msgstr "Emails will be sent from this approved account."
|
||||
|
||||
#. module: email_template
|
||||
#: field:email.template,def_subject:0
|
||||
msgid "Default Subject"
|
||||
msgstr "Default Subject"
|
||||
msgid "Subject"
|
||||
msgstr "Subject"
|
||||
|
||||
#. module: email_template
|
||||
#: help:email.template,def_bcc:0
|
||||
@@ -1182,8 +1174,8 @@ msgstr "Has Attachments"
|
||||
|
||||
#. module: email_template
|
||||
#: help:email.template,track_campaign_item:0
|
||||
msgid "Enable this if you want the outgoing e-mails to include a tracking marker that makes it possible to identify the replies an link them back to the campaign item"
|
||||
msgstr "Enable this if you want the outgoing e-mails to include a tracking marker that makes it possible to identify the replies an link them back to the campaign item"
|
||||
msgid "Enable this is you wish to include a special tracking marker in outgoing emails so you can identify replies and link them back to the corresponding resource record. This is useful for CRM leads for example"
|
||||
msgstr "Enable this is you wish to include a special tracking marker in outgoing emails so you can identify replies and link them back to the corresponding resource record. This is useful for CRM leads for example"
|
||||
|
||||
#. module: email_template
|
||||
#: code:addons/email_template/email_template.py:0
|
||||
|
||||
@@ -348,11 +348,6 @@ msgstr ""
|
||||
msgid "Send/Receive"
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_mailbox_all_main2
|
||||
msgid "MailBox"
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.actions.act_window,name:email_template.wizard_email_template_preview
|
||||
msgid "Template Preview"
|
||||
@@ -1145,11 +1140,6 @@ msgstr ""
|
||||
msgid "Enter name of outgoing server, eg:smtp.gmail.com "
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: model:ir.ui.menu,name:email_template.menu_email_template_company_mails
|
||||
msgid "Company Mails"
|
||||
msgstr ""
|
||||
|
||||
#. module: email_template
|
||||
#: view:email.template:0
|
||||
msgid "Addresses"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<field name="body_html" select="2" colspan="4" nolabel="1" />
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<label string="Add here all attachments of the current document you want to include in the e-mail." colspan="4"/>
|
||||
<label string="Add here all attachments of the current document you want to include in the Email." colspan="4"/>
|
||||
<field name="attachment_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
@@ -32,7 +32,7 @@ class marketing_installer(osv.osv_memory):
|
||||
'marketing_campaign_mailchimp':fields.boolean('Mailchimp Integration',
|
||||
help="This modules integrate mailchimp.com's service with OpenERP to automate mass mailings."),
|
||||
'crm_profiling':fields.boolean('Profiling Tools',
|
||||
help="Helps you to perform segmentation within partners and design questionaires.")
|
||||
help="Helps you to perform segmentation within partners and design segmentation questionnaires")
|
||||
}
|
||||
marketing_installer()
|
||||
|
||||
|
||||
@@ -30,14 +30,16 @@
|
||||
"author" : "OpenERP SA",
|
||||
"category": 'Generic Modules/Marketing',
|
||||
"description": """
|
||||
Allows you to setup leads automation through marketing campaigns. The campaigns
|
||||
are dynamic and multi-channels. The process:
|
||||
* Design marketing campaigns that incluces mail templates, reports to print,
|
||||
miscelleanous actions, etc.
|
||||
* Define segments that are selections of target people
|
||||
* Launch your campaign to automate communications.
|
||||
|
||||
If you need demo data, you can install the module marketing_campaign_crm_demo.
|
||||
This module provides leads automation through marketing campaigns (campaigns can in fact be defined on any resource, not just CRM Leads).
|
||||
The campaigns are dynamic and multi-channels. The process is as follows:
|
||||
* Design marketing campaigns like workflows, including email templates to send, reports to print and send by email, custom actions, etc.
|
||||
* Define input segments that will select the items that should enter the campaign (e.g leads from certain countries, etc.)
|
||||
* Run you campaign in simulation mode to test it real-time or accelerated, and fine-tune it
|
||||
* You may also start the real campaign in manual mode, where each action requires manual validation
|
||||
* Finally launch your campaign live, and watch the statistics as the campaign does everything fully automatically.
|
||||
While the campaign runs you can of course continue to fine-tune the parameters, input segments, workflow, etc.
|
||||
|
||||
Note: If you need demo data, you can install the marketing_campaign_crm_demo module, but this will also install the CRM application as it depends on CRM Leads.
|
||||
""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'init_xml': [],
|
||||
|
||||
@@ -1,914 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * marketing_campaign
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2010-08-20 07:30:00+0000\n"
|
||||
"PO-Revision-Date: 2010-08-20 07:30:00+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The current step for this item has no email or report to preview."
|
||||
msgstr "The current step for this item has no email or report to preview."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,trigger:0
|
||||
msgid "Time"
|
||||
msgstr "Time"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: view:marketing.campaign:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Group By..."
|
||||
msgstr "Group By..."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.transition,trigger:0
|
||||
msgid "Trigger"
|
||||
msgstr "Trigger"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr "Invalid model name in the action definition."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:campaign.analysis,count:0
|
||||
msgid "# of Actions"
|
||||
msgstr "# of Actions"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
msgid "Campaign Editor"
|
||||
msgstr "Campaign Editor"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
msgid "Today"
|
||||
msgstr "Today"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "March"
|
||||
msgstr "March"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,object_id:0
|
||||
#: field:marketing.campaign.segment,object_id:0
|
||||
#: field:marketing.campaign.workitem,object_id:0
|
||||
msgid "Object"
|
||||
msgstr "Object"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Set to Draft"
|
||||
msgstr "Set to Draft"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,to_ids:0
|
||||
msgid "Next Activities"
|
||||
msgstr "Next Activities"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Synchronization"
|
||||
msgstr "Synchronization"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
msgid "This Year"
|
||||
msgstr "This Year"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign,partner_field_id:0
|
||||
msgid "The generated workitems will be linked to the partner related to the record. If the record is the partner itself left this field empty."
|
||||
msgstr "The generated workitems will be linked to the partner related to the record. If the record is the partner itself left this field empty."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "No preview"
|
||||
msgstr "No preview"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.activity:0
|
||||
msgid "Outgoing Transitions"
|
||||
msgstr "Outgoing Transitions"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Reset"
|
||||
msgstr "Reset"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,type:0
|
||||
msgid "Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."
|
||||
msgstr "Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,interval_type:0
|
||||
msgid "Year(s)"
|
||||
msgstr "Year(s)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,report_directory_id:0
|
||||
msgid "This folder is used to store the generated reports"
|
||||
msgstr "This folder is used to store the generated reports"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: selection:marketing.campaign,state:0
|
||||
#: selection:marketing.campaign.segment,state:0
|
||||
#: selection:marketing.campaign.workitem,state:0
|
||||
msgid "Cancelled"
|
||||
msgstr "Cancelled"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,trigger:0
|
||||
msgid "Automatic"
|
||||
msgstr "Automatic"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.activity:0
|
||||
msgid "Activity Definition"
|
||||
msgstr "Activity Definition"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,keep_if_condition_not_met:0
|
||||
msgid "Keep as cancelled when condition not met"
|
||||
msgstr "Keep as cancelled when condition not met"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign,mode:0
|
||||
msgid "Test - It creates and process all the activities directly (without waiting for the delay on transitions) but does not send emails or produce reports.\n"
|
||||
"Test in Realtime - It creates and processes all the activities directly but does not send emails or produce reports.\n"
|
||||
"With Manual Confirmation - the campaigns runs normally, but the user has to validate all workitem manually.\n"
|
||||
"Normal - the campaign runs normally and automatically sends all emails and reports (be very careful with this mode, you're live!)"
|
||||
msgstr "Test - It creates and process all the activities directly (without waiting for the delay on transitions) but does not send emails or produce reports.\n"
|
||||
"Test in Realtime - It creates and processes all the activities directly but does not send emails or produce reports.\n"
|
||||
"With Manual Confirmation - the campaigns runs normally, but the user has to validate all workitem manually.\n"
|
||||
"Normal - the campaign runs normally and automatically sends all emails and reports (be very careful with this mode, you're live!)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,campaign_id:0
|
||||
#: view:marketing.campaign:0
|
||||
#: field:marketing.campaign.activity,campaign_id:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: field:marketing.campaign.segment,campaign_id:0
|
||||
#: field:marketing.campaign.workitem,campaign_id:0
|
||||
msgid "Campaign"
|
||||
msgstr "Campaign"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,start:0
|
||||
msgid "Start"
|
||||
msgstr "Start"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,segment_id:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: field:marketing.campaign.workitem,segment_id:0
|
||||
msgid "Segment"
|
||||
msgstr "Segment"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.segment,sync_mode:0
|
||||
msgid "Workitem creation mode"
|
||||
msgstr "Workitem creation mode"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,interval_type:0
|
||||
msgid "Month(s)"
|
||||
msgstr "Month(s)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The campaign hasn't any starting activity nor any activity with a signal and no previous activity."
|
||||
msgstr "The campaign hasn't any starting activity nor any activity with a signal and no previous activity."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,partner_id:0
|
||||
#: model:ir.model,name:marketing_campaign.model_res_partner
|
||||
#: field:marketing.campaign.workitem,partner_id:0
|
||||
msgid "Partner"
|
||||
msgstr "Partner"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.segment,sync_mode:0
|
||||
msgid "If record created after last sync"
|
||||
msgstr "If record created after last sync"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.activity:0
|
||||
msgid "Transitions"
|
||||
msgstr "Transitions"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Create After Sync"
|
||||
msgstr "Create After Sync"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Dates"
|
||||
msgstr "Dates"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.segment,sync_mode:0
|
||||
msgid "Determines when new workitems should be created for records matching a segment."
|
||||
msgstr "Determines when new workitems should be created for records matching a segment."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: view:marketing.campaign:0
|
||||
#: field:marketing.campaign,state:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: field:marketing.campaign.segment,state:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: field:marketing.campaign.workitem,state:0
|
||||
msgid "State"
|
||||
msgstr "State"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.module.module,description:marketing_campaign.module_meta_information
|
||||
msgid "\n"
|
||||
"Allows you to setup leads automation through marketing campaigns. The campaigns\n"
|
||||
"are dynamic and multi-channels. The process:\n"
|
||||
"* Design marketing campaigns that incluces mail templates, reports to print,\n"
|
||||
" miscelleanous actions, etc.\n"
|
||||
"* Define segments that are selections of target people\n"
|
||||
"* Launch your campaign to automate communications.\n"
|
||||
"\n"
|
||||
"If you need demo data, you can install the module marketing_campaign_crm_demo.\n"
|
||||
" "
|
||||
msgstr "\n"
|
||||
"Allows you to setup leads automation through marketing campaigns. The campaigns\n"
|
||||
"are dynamic and multi-channels. The process:\n"
|
||||
"* Design marketing campaigns that incluces mail templates, reports to print,\n"
|
||||
" miscelleanous actions, etc.\n"
|
||||
"* Define segments that are selections of target people\n"
|
||||
"* Launch your campaign to automate communications.\n"
|
||||
"\n"
|
||||
"If you need demo data, you can install the module marketing_campaign_crm_demo.\n"
|
||||
" "
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,condition:0
|
||||
msgid "Python expression to decide whether the activity can be executed, otherwise it will be deleted or cancelled.The expression may use the following [browsable] variables:\n"
|
||||
" - activity: the campaign activity\n"
|
||||
" - workitem: the campaign workitem\n"
|
||||
" - object: the object this campaign item represents\n"
|
||||
" - transitions: list of campaign transitions outgoing from this activity\n"
|
||||
"...- re: Python regular expression module"
|
||||
msgstr "Python expression to decide whether the activity can be executed, otherwise it will be deleted or cancelled.The expression may use the following [browsable] variables:\n"
|
||||
" - activity: the campaign activity\n"
|
||||
" - workitem: the campaign workitem\n"
|
||||
" - object: the object this campaign item represents\n"
|
||||
" - transitions: list of campaign transitions outgoing from this activity\n"
|
||||
"...- re: Python regular expression module"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
msgid "Marketing Reports"
|
||||
msgstr "Marketing Reports"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,type:0
|
||||
msgid "Type"
|
||||
msgstr "Type"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.workitem,res_name:0
|
||||
msgid "Resource Name"
|
||||
msgstr "Resource Name"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Run"
|
||||
msgstr "Run"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The campaign cannot be started: an email account is missing in the email activity '%s'"
|
||||
msgstr "The campaign cannot be started: an email account is missing in the email activity '%s'"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,from_ids:0
|
||||
msgid "Previous Activities"
|
||||
msgstr "Previous Activities"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.transition,activity_from_id:0
|
||||
msgid "Previous Activity"
|
||||
msgstr "Previous Activity"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Marketing Campaign Activities"
|
||||
msgstr "Marketing Campaign Activities"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: field:marketing.campaign.workitem,error_msg:0
|
||||
msgid "Error Message"
|
||||
msgstr "Error Message"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.actions.act_window,name:marketing_campaign.action_campaign_analysis_all
|
||||
#: model:ir.actions.act_window,name:marketing_campaign.action_marketing_campaign_form
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_action_campaign_analysis_all
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_marketing_campaign
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_marketing_campaign_form
|
||||
#: view:marketing.campaign:0
|
||||
msgid "Campaigns"
|
||||
msgstr "Campaigns"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.transition,interval_type:0
|
||||
msgid "Interval Unit"
|
||||
msgstr "Interval Unit"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:campaign.analysis,country_id:0
|
||||
msgid "Country"
|
||||
msgstr "Country"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "July"
|
||||
msgstr "July"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_marketing_configuration
|
||||
msgid "Configuration"
|
||||
msgstr "Configuration"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: constraint:ir.cron:0
|
||||
msgid "Invalid arguments"
|
||||
msgstr "Invalid arguments"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr "Invalid XML for View Architecture!"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,interval_type:0
|
||||
msgid "Hour(s)"
|
||||
msgstr "Hour(s)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_marketing_campaign_segment
|
||||
msgid "Campaign Segment"
|
||||
msgstr "Campaign Segment"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Cancel"
|
||||
msgstr "Cancel"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,keep_if_condition_not_met:0
|
||||
msgid "By activating this option, workitems that aren't executed because the condition is not met are marked as cancelled instead of being deleted."
|
||||
msgstr "By activating this option, workitems that aren't executed because the condition is not met are marked as cancelled instead of being deleted."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
msgid "Exceptions"
|
||||
msgstr "Exceptions"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:res.partner,workitem_ids:0
|
||||
msgid "Workitems"
|
||||
msgstr "Workitems"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign,fixed_cost:0
|
||||
msgid "Fixed Cost"
|
||||
msgstr "Fixed Cost"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.transition,interval_nbr:0
|
||||
msgid "Interval Value"
|
||||
msgstr "Interval Value"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:campaign.analysis,revenue:0
|
||||
#: field:marketing.campaign.activity,revenue:0
|
||||
msgid "Revenue"
|
||||
msgstr "Revenue"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "September"
|
||||
msgstr "September"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "December"
|
||||
msgstr "December"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,month:0
|
||||
msgid "Month"
|
||||
msgstr "Month"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.transition,activity_to_id:0
|
||||
msgid "Next Activity"
|
||||
msgstr "Next Activity"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,email_template_id:0
|
||||
msgid "The e-mail to send when this activity is activated"
|
||||
msgstr "The e-mail to send when this activity is activated"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
msgid "This Month"
|
||||
msgstr "This Month"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
msgid "Test Mode"
|
||||
msgstr "Test Mode"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_ir_actions_report_xml
|
||||
msgid "ir.actions.report.xml"
|
||||
msgstr "ir.actions.report.xml"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
msgid "Manual Mode"
|
||||
msgstr "Manual Mode"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,server_action_id:0
|
||||
msgid "The action to perform when this activity is activated"
|
||||
msgstr "The action to perform when this activity is activated"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign,partner_field_id:0
|
||||
msgid "Partner Field"
|
||||
msgstr "Partner Field"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_campaign_analysis
|
||||
msgid "Campaign Analysis"
|
||||
msgstr "Campaign Analysis"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign,mode:0
|
||||
msgid "Test in Realtime"
|
||||
msgstr "Test in Realtime"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign,mode:0
|
||||
msgid "Test Directly"
|
||||
msgstr "Test Directly"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,report_directory_id:0
|
||||
msgid "Directory"
|
||||
msgstr "Directory"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.segment,sync_last_date:0
|
||||
msgid "Latest Synchronization"
|
||||
msgstr "Latest Synchronization"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: selection:marketing.campaign,state:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: selection:marketing.campaign.segment,state:0
|
||||
msgid "Draft"
|
||||
msgstr "Draft"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: constraint:ir.ui.menu:0
|
||||
msgid "Error ! You can not create recursive Menu."
|
||||
msgstr "Error ! You can not create recursive Menu."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.segment,date_run:0
|
||||
msgid "Launching Date"
|
||||
msgstr "Launching Date"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: constraint:ir.model:0
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr "The Object name must start with x_ and not contain any special character !"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Preview"
|
||||
msgstr "Preview"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Run Date"
|
||||
msgstr "Run Date"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Related Resource"
|
||||
msgstr "Related Resource"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "August"
|
||||
msgstr "August"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign,mode:0
|
||||
msgid "Normal"
|
||||
msgstr "Normal"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,start:0
|
||||
msgid "This activity is launched when the campaign starts."
|
||||
msgstr "This activity is launched when the campaign starts."
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.activity,signal:0
|
||||
msgid "An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent"
|
||||
msgstr "An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "June"
|
||||
msgstr "June"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.segment,sync_mode:0
|
||||
msgid "All records (no duplicates)"
|
||||
msgstr "All records (no duplicates)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,date:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Date"
|
||||
msgstr "Date"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "November"
|
||||
msgstr "November"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,condition:0
|
||||
msgid "Condition"
|
||||
msgstr "Condition"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,report_id:0
|
||||
msgid "The report to generate when this activity is activated"
|
||||
msgstr "The report to generate when this activity is activated"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: selection:marketing.campaign.workitem,state:0
|
||||
msgid "Exception"
|
||||
msgstr "Exception"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "October"
|
||||
msgstr "October"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign,fixed_cost:0
|
||||
msgid "Fixed cost for the campaign (used for campaign analysis), see also variable cost on activities"
|
||||
msgstr "Fixed cost for the campaign (used for campaign analysis), see also variable cost on activities"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "January"
|
||||
msgstr "January"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: field:marketing.campaign.workitem,date:0
|
||||
msgid "Execution Date"
|
||||
msgstr "Execution Date"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_marketing_campaign_workitem
|
||||
msgid "Campaign Workitem"
|
||||
msgstr "Campaign Workitem"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.segment,ir_filter_id:0
|
||||
msgid "Filter"
|
||||
msgstr "Filter"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Synchronize"
|
||||
msgstr "Synchronize"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "Error"
|
||||
msgstr "Error"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.activity:0
|
||||
#: field:marketing.campaign.activity,server_action_id:0
|
||||
#: selection:marketing.campaign.activity,type:0
|
||||
msgid "Action"
|
||||
msgstr "Action"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "Automatic transition"
|
||||
msgstr "Automatic transition"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:res.partner:0
|
||||
msgid "History"
|
||||
msgstr "History"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign,object_id:0
|
||||
msgid "Choose the model on which you want this campaign to be run"
|
||||
msgstr "Choose the model on which you want this campaign to be run"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.module.module,shortdesc:marketing_campaign.module_meta_information
|
||||
msgid "marketing_campaign"
|
||||
msgstr "marketing_campaign"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Process"
|
||||
msgstr "Process"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#: selection:marketing.campaign.transition,trigger:0
|
||||
#, python-format
|
||||
msgid "Cosmetic"
|
||||
msgstr "Cosmetic"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.transition,trigger:0
|
||||
msgid "How is the destination workitem triggered"
|
||||
msgstr "How is the destination workitem triggered"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: selection:marketing.campaign,state:0
|
||||
#: selection:marketing.campaign.segment,state:0
|
||||
#: selection:marketing.campaign.workitem,state:0
|
||||
msgid "Done"
|
||||
msgstr "Done"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_email_template
|
||||
msgid "Email Templates for Models"
|
||||
msgstr "Email Templates for Models"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Close"
|
||||
msgstr "Close"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The campaign cannot be marked as done before all segments are done"
|
||||
msgstr "The campaign cannot be marked as done before all segments are done"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.workitem,res_id:0
|
||||
msgid "Resource ID"
|
||||
msgstr "Resource ID"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_marketing_campaign_transition
|
||||
msgid "Campaign Transition"
|
||||
msgstr "Campaign Transition"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: selection:marketing.campaign.workitem,state:0
|
||||
msgid "To Do"
|
||||
msgstr "To Do"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.workitem:0
|
||||
msgid "Campaign Step"
|
||||
msgstr "Campaign Step"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.actions.act_window,name:marketing_campaign.action_marketing_campaign_segment_form
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_marketing_campaign_segment_form
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Segments"
|
||||
msgstr "Segments"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.actions.act_window,name:marketing_campaign.act_marketing_campaing_segment_opened
|
||||
msgid "All Segments"
|
||||
msgstr "All Segments"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.activity:0
|
||||
msgid "Incoming Transitions"
|
||||
msgstr "Incoming Transitions"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.activity,type:0
|
||||
msgid "E-mail"
|
||||
msgstr "E-mail"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The campaign cannot be started: the email account is not approved in the email activity '%s'"
|
||||
msgstr "The campaign cannot be started: the email account is not approved in the email activity '%s'"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.transition,interval_type:0
|
||||
msgid "Day(s)"
|
||||
msgstr "Day(s)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign,activity_ids:0
|
||||
#: view:marketing.campaign.activity:0
|
||||
msgid "Activities"
|
||||
msgstr "Activities"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "May"
|
||||
msgstr "May"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign.segment:0
|
||||
msgid "Modified after Sync"
|
||||
msgstr "Modified after Sync"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: selection:marketing.campaign,state:0
|
||||
#: view:marketing.campaign.segment:0
|
||||
#: selection:marketing.campaign.segment,state:0
|
||||
msgid "Running"
|
||||
msgstr "Running"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.activity,type:0
|
||||
msgid "Paper"
|
||||
msgstr "Paper"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "After %(interval_nbr)d %(interval_type)s"
|
||||
msgstr "After %(interval_nbr)d %(interval_type)s"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_marketing_campaign
|
||||
msgid "Marketing Campaign"
|
||||
msgstr "Marketing Campaign"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.segment,date_done:0
|
||||
msgid "End Date"
|
||||
msgstr "End Date"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "February"
|
||||
msgstr "February"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: field:marketing.campaign,object_id:0
|
||||
msgid "Resource"
|
||||
msgstr "Resource"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign,name:0
|
||||
#: field:marketing.campaign.activity,name:0
|
||||
#: field:marketing.campaign.segment,name:0
|
||||
#: field:marketing.campaign.transition,name:0
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "Email Preview"
|
||||
msgstr "Email Preview"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,signal:0
|
||||
msgid "Signal"
|
||||
msgstr "Signal"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: help:marketing.campaign.workitem,date:0
|
||||
msgid "If date is not set, this workitem have to be run manually"
|
||||
msgstr "If date is not set, this workitem have to be run manually"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: code:addons/marketing_campaign/marketing_campaign.py:0
|
||||
#, python-format
|
||||
msgid "The campaign cannot be started: there are no activities in it"
|
||||
msgstr "The campaign cannot be started: there are no activities in it"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:campaign.analysis,month:0
|
||||
msgid "April"
|
||||
msgstr "April"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:marketing.campaign:0
|
||||
#: field:marketing.campaign,mode:0
|
||||
msgid "Mode"
|
||||
msgstr "Mode"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:campaign.analysis,activity_id:0
|
||||
#: view:marketing.campaign.workitem:0
|
||||
#: field:marketing.campaign.workitem,activity_id:0
|
||||
msgid "Activity"
|
||||
msgstr "Activity"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.actions.act_window,name:marketing_campaign.action_marketing_campaign_workitem
|
||||
#: model:ir.ui.menu,name:marketing_campaign.menu_action_marketing_campaign_workitem
|
||||
msgid "Campaign Followup"
|
||||
msgstr "Campaign Followup"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: model:ir.model,name:marketing_campaign.model_marketing_campaign_activity
|
||||
msgid "Campaign Activity"
|
||||
msgstr "Campaign Activity"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: field:marketing.campaign.activity,variable_cost:0
|
||||
msgid "Variable Cost"
|
||||
msgstr "Variable Cost"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign.segment,sync_mode:0
|
||||
msgid "If record modified after last sync (no duplicates)"
|
||||
msgstr "If record modified after last sync (no duplicates)"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: selection:marketing.campaign,mode:0
|
||||
msgid "With Manual Confirmation"
|
||||
msgstr "With Manual Confirmation"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,total_cost:0
|
||||
msgid "Cost"
|
||||
msgstr "Cost"
|
||||
|
||||
#. module: marketing_campaign
|
||||
#: view:campaign.analysis:0
|
||||
#: field:campaign.analysis,year:0
|
||||
msgid "Year"
|
||||
msgstr "Year"
|
||||
|
||||
@@ -91,7 +91,7 @@ class marketing_campaign(osv.osv):
|
||||
this campaign to be run"),
|
||||
'partner_field_id': fields.many2one('ir.model.fields', 'Partner Field',
|
||||
domain="[('model_id', '=', object_id), ('ttype', '=', 'many2one'), ('relation', '=', 'res.partner')]",
|
||||
help="The generated workitems will be linked to the partner related to the record. If the record is the partner itself left this field empty."),
|
||||
help="The generated workitems will be linked to the partner related to the record. If the record is the partner itself leave this field empty."),
|
||||
'mode': fields.selection([('test', 'Test Directly'),
|
||||
('test_realtime', 'Test in Realtime'),
|
||||
('manual', 'With Manual Confirmation'),
|
||||
@@ -108,7 +108,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor
|
||||
'State',),
|
||||
'activity_ids': fields.one2many('marketing.campaign.activity',
|
||||
'campaign_id', 'Activities'),
|
||||
'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for the campaign (used for campaign analysis), see also variable cost on activities"),
|
||||
'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting."),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -220,20 +220,20 @@ class marketing_campaign_segment(osv.osv):
|
||||
'object_id': fields.related('campaign_id','object_id',
|
||||
type='many2one', relation='ir.model',
|
||||
string='Object'),
|
||||
'ir_filter_id': fields.many2one('ir.filters', 'Filter', help=""),
|
||||
'sync_last_date': fields.datetime('Latest Synchronization'),
|
||||
'ir_filter_id': fields.many2one('ir.filters', 'Filter', help="Filter to select the matching resource records that belong to this segment. New filters can be created and saved using the advanced search on the list view of the Resource"),
|
||||
'sync_last_date': fields.datetime('Last Synchronization', help="Date on which this segment was synchronized last time (automatically or manually)"),
|
||||
'sync_mode': fields.selection([('create_date', 'If record created after last sync'),
|
||||
('write_date', 'If record modified after last sync (no duplicates)'),
|
||||
('all', 'All records (no duplicates)')],
|
||||
'Workitem creation mode',
|
||||
help="Determines when new workitems should be created for records matching a segment."),
|
||||
help="Determines how new campaign workitems are created for resource records matching this segment. This is used when segments are synchronized manually, or automatically via the scheduled job."),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('running', 'Running'),
|
||||
('done', 'Done'),
|
||||
('cancelled', 'Cancelled')],
|
||||
'State',),
|
||||
'date_run': fields.datetime('Launching Date'),
|
||||
'date_done': fields.datetime('End Date'),
|
||||
'date_run': fields.datetime('Launching Date', help="Initial start date of this segment."),
|
||||
'date_done': fields.datetime('End Date', help="Date this segment was last closed or cancelled."),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -241,6 +241,34 @@ class marketing_campaign_segment(osv.osv):
|
||||
'sync_mode': lambda *a: 'create_date',
|
||||
}
|
||||
|
||||
def _check_model(self, cr, uid, ids, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
if not obj.ir_filter_id:
|
||||
return True
|
||||
if obj.campaign_id.object_id.model != obj.ir_filter_id.model_id:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_model, _('Model of filter must be same as resource model of Campaign '), ['ir_filter_id,campaign_id']),
|
||||
]
|
||||
|
||||
def onchange_campaign_id(self, cr, uid, ids, campaign_id):
|
||||
res = {'domain':{'ir_filter_id':[]}}
|
||||
campaign_pool = self.pool.get('marketing.campaign')
|
||||
if campaign_id:
|
||||
campaign = campaign_pool.browse(cr, uid, campaign_id)
|
||||
model_name = self.pool.get('ir.model').read(cr, uid, [campaign.object_id.id], ['model'])
|
||||
if model_name:
|
||||
mod_name = model_name[0]['model']
|
||||
res['domain'] = {'ir_filter_id': [('model_id', '=', mod_name)]}
|
||||
res['context'] = {'default_model_id': model_name[0]['model']}
|
||||
else:
|
||||
res['value'] = {'ir_filter_id': False}
|
||||
return res
|
||||
|
||||
def state_running_set(self, cr, uid, ids, *args):
|
||||
segment = self.browse(cr, uid, ids[0])
|
||||
vals = {'state': 'running'}
|
||||
@@ -325,8 +353,8 @@ class marketing_campaign_activity(osv.osv):
|
||||
|
||||
_action_types = [
|
||||
('email', 'E-mail'),
|
||||
('paper', 'Paper'),
|
||||
('action', 'Action'),
|
||||
('report', 'Report'),
|
||||
('action', 'Custom Action'),
|
||||
# TODO implement the subcampaigns.
|
||||
# TODO implement the subcampaign out. disallow out transitions from
|
||||
# subcampaign activities ?
|
||||
@@ -346,13 +374,17 @@ class marketing_campaign_activity(osv.osv):
|
||||
"The expression may use the following [browsable] variables:\n"
|
||||
" - activity: the campaign activity\n"
|
||||
" - workitem: the campaign workitem\n"
|
||||
" - object: the object this campaign item represents\n"
|
||||
" - resource: the resource object this campaign item represents\n"
|
||||
" - transitions: list of campaign transitions outgoing from this activity\n"
|
||||
"...- re: Python regular expression module"),
|
||||
'type': fields.selection(_action_types, 'Type', required=True,
|
||||
help="Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."),
|
||||
'email_template_id': fields.many2one('email.template','The e-mail to send when this activity is activated'),
|
||||
'report_id': fields.many2one('ir.actions.report.xml', 'The report to generate when this activity is activated', ),
|
||||
help="""The type of action to execute when an item enters this activity, such as:
|
||||
- Email: send an email using a predefined email template
|
||||
- Report: print an existing Report defined on the resource item and save it into a specific directory
|
||||
- Custom Action: execute a predefined action, e.g. to modify the fields of the resource record
|
||||
"""),
|
||||
'email_template_id': fields.many2one('email.template', "Email Template", help='The e-mail to send when this activity is activated'),
|
||||
'report_id': fields.many2one('ir.actions.report.xml', "Report", help='The report to generate when this activity is activated', ),
|
||||
'report_directory_id': fields.many2one('document.directory','Directory',
|
||||
help="This folder is used to store the generated reports"),
|
||||
'server_action_id': fields.many2one('ir.actions.server', string='Action',
|
||||
@@ -363,11 +395,11 @@ class marketing_campaign_activity(osv.osv):
|
||||
'from_ids': fields.one2many('marketing.campaign.transition',
|
||||
'activity_to_id',
|
||||
'Previous Activities'),
|
||||
'variable_cost': fields.float('Variable Cost'),
|
||||
'revenue': fields.float('Revenue'),
|
||||
'variable_cost': fields.float('Variable Cost', help="Set a variable cost if you consider that every campaign item that has reached this point has entailed a certain cost. You can get cost statistics in the Reporting section"),
|
||||
'revenue': fields.float('Revenue', help="Set an expected revenue if you consider that every campaign item that has reached this point has generated a certain revenue. You can get revenue statistics in the Reporting section"),
|
||||
'signal': fields.char('Signal', size=128,
|
||||
help='An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent'),
|
||||
'keep_if_condition_not_met': fields.boolean('Keep as cancelled when condition not met',
|
||||
'keep_if_condition_not_met': fields.boolean("Don't delete workitems",
|
||||
help="By activating this option, workitems that aren't executed because the condition is not met are marked as cancelled instead of being deleted.")
|
||||
}
|
||||
|
||||
@@ -517,23 +549,50 @@ class marketing_campaign_workitem(osv.osv):
|
||||
res[wi.id] = ng[0][1]
|
||||
return res
|
||||
|
||||
def _resource_search(self, cr, uid, obj, name, args, domain=None, context=None):
|
||||
"""Returns id of workitem whose resource_name matches with the given name"""
|
||||
if context is None:
|
||||
context = {}
|
||||
if not len(args):
|
||||
return []
|
||||
|
||||
condition = []
|
||||
final_ids = []
|
||||
|
||||
cr.execute("""select w.id, w.res_id, m.model \
|
||||
from marketing_campaign_workitem w \
|
||||
left join marketing_campaign_activity a on (a.id=w.activity_id)\
|
||||
left join marketing_campaign c on (c.id=a.campaign_id)\
|
||||
left join ir_model m on (m.id=c.object_id)
|
||||
""")
|
||||
res = cr.fetchall()
|
||||
for id, res_id, model in res:
|
||||
model_pool = self.pool.get(model)
|
||||
for arg in args:
|
||||
if arg[1] == 'ilike':
|
||||
condition.append((model_pool._rec_name, 'ilike', arg[2]))
|
||||
res_ids = model_pool.search(cr, uid, condition, context=context)
|
||||
if res_id in res_ids:
|
||||
final_ids.append(id)
|
||||
return [('id', 'in', final_ids)]
|
||||
|
||||
_columns = {
|
||||
'segment_id': fields.many2one('marketing.campaign.segment', 'Segment'),
|
||||
'segment_id': fields.many2one('marketing.campaign.segment', 'Segment', readonly=True),
|
||||
'activity_id': fields.many2one('marketing.campaign.activity','Activity',
|
||||
required=True),
|
||||
required=True, readonly=True),
|
||||
'campaign_id': fields.related('activity_id', 'campaign_id',
|
||||
type='many2one', relation='marketing.campaign', string='Campaign', readonly=True),
|
||||
'object_id': fields.related('activity_id', 'campaign_id', 'object_id',
|
||||
type='many2one', relation='ir.model', string='Object', select=1),
|
||||
'res_id': fields.integer('Resource ID', select=1, readonly=1),
|
||||
'res_name': fields.function(_res_name_get, method=True, string='Resource Name', type="char", size=64),
|
||||
'date': fields.datetime('Execution Date', help='If date is not set, this workitem have to be run manually'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', select=1),
|
||||
type='many2one', relation='ir.model', string='Resource', select=1, readonly=True),
|
||||
'res_id': fields.integer('Resource ID', select=1, readonly=True),
|
||||
'res_name': fields.function(_res_name_get, method=True, string='Resource Name', fnct_search=_resource_search, type="char", size=64),
|
||||
'date': fields.datetime('Execution Date', help='If date is not set, this workitem has to be run manually', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', select=1, readonly=True),
|
||||
'state': fields.selection([('todo', 'To Do'),
|
||||
('exception', 'Exception'), ('done', 'Done'),
|
||||
('cancelled', 'Cancelled')], 'State'),
|
||||
('cancelled', 'Cancelled')], 'State', readonly=True),
|
||||
|
||||
'error_msg' : fields.text('Error Message')
|
||||
'error_msg' : fields.text('Error Message', readonly=True)
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'todo',
|
||||
@@ -564,6 +623,7 @@ class marketing_campaign_workitem(osv.osv):
|
||||
'activity': activity,
|
||||
'workitem': workitem,
|
||||
'object': object_id,
|
||||
'resource': object_id,
|
||||
'transitions': activity.to_ids,
|
||||
're': re,
|
||||
}
|
||||
@@ -688,7 +748,7 @@ class marketing_campaign_workitem(osv.osv):
|
||||
wi_obj.res_id)
|
||||
}
|
||||
|
||||
elif wi_obj.activity_id.type == 'paper':
|
||||
elif wi_obj.activity_id.type == 'report':
|
||||
datas = {
|
||||
'ids': [wi_obj.res_id],
|
||||
'model': wi_obj.object_id.model
|
||||
|
||||
@@ -17,11 +17,20 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Campaign">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="object_id" select="1"/>
|
||||
<field name="mode"/>
|
||||
<field name="fixed_cost"/>
|
||||
<field name="partner_field_id"/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Campaign" colspan="2" />
|
||||
<field name="name" select="1"/>
|
||||
<field name="mode"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Resource" colspan="2" />
|
||||
<field name="object_id" select="1"/>
|
||||
<field name="partner_field_id"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Cost" colspan="2" />
|
||||
<field name="fixed_cost"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="activity_ids" nolabel = "1" colspan="4" default_get="{'default_object_id': object_id}" />
|
||||
<separator string="Status" colspan="4" />
|
||||
@@ -45,6 +54,7 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="object_id" select="1"/>
|
||||
<field name="mode"/>
|
||||
<field name="fixed_cost"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -125,27 +135,31 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Segments">
|
||||
<group colspan="4" col="6">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Segment" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="campaign_id" select="1"/>
|
||||
<field name="ir_filter_id" select="1"/>
|
||||
<field name="object_id" invisible="1" readonly="True"/>
|
||||
<field name="campaign_id" select="1" on_change="onchange_campaign_id(campaign_id)"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Synchronization" colspan="2"/>
|
||||
<separator string="Filter" colspan="4"/>
|
||||
<field name="ir_filter_id" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Synchronization" colspan="4"/>
|
||||
<field name="sync_mode" required="True"/>
|
||||
<field name="sync_last_date"/>
|
||||
<label string="" colspan="1"/>
|
||||
<button string="Synchronize" states="running" name="synchroniz" icon="gtk-apply" type="object"/>
|
||||
<button string="Synchronize" states="running" name="synchroniz" icon="terp-project" type="object"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Dates" colspan="2"/>
|
||||
<separator string="History" colspan="2"/>
|
||||
<field name="date_run" readonly="1"/>
|
||||
<field name="date_done" readonly="1"/>
|
||||
</group>
|
||||
<separator string="Status" colspan="4"/>
|
||||
<group col="10" colspan="4">
|
||||
<field name="state" readonly="1" select="2" nolabel="1"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="state_running_set" string="Run" states="draft" icon="gtk-apply"/>
|
||||
<button name="state_done_set" string="Close" states="running" icon="terp-dialog-close"/>
|
||||
<button name="state_cancel_set" string="Cancel" states="running" icon="terp-gtk-stop"/>
|
||||
@@ -179,8 +193,9 @@
|
||||
<filter icon="terp-check" string="Running" name="running" domain="[('state','=','running')]"/>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-month" string="Create After Sync" domain="[('sync_mode','=','create_date')]"/>
|
||||
<filter icon="terp-go-month" string="Modified after Sync" domain="[('sync_mode','=','write_date')]"/>
|
||||
<filter icon="terp-project" string="Newly Created" domain="[('sync_mode','=','create_date')]"/>
|
||||
<filter icon="terp-project" string="Newly Modified" domain="[('sync_mode','=','write_date')]"/>
|
||||
<filter icon="terp-project" string="All" domain="[('sync_mode','=','all')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="campaign_id" select="1"/>
|
||||
@@ -225,36 +240,38 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Activities">
|
||||
<field name="object_id" invisible="1"/>
|
||||
<separator string="Activity Definition" colspan="4"/>
|
||||
<field name="name" select="1" colspan='4' />
|
||||
<field name="signal"/>
|
||||
<field name="start"/>
|
||||
<field name="variable_cost" select="1"/>
|
||||
<group colspan='2' col='2'>
|
||||
<separator string="Activity" colspan="4"/>
|
||||
<field name="name" select="1" colspan='4' />
|
||||
<field name="signal" groups="base.group_extended"/>
|
||||
<field name="start"/>
|
||||
<field name="object_id" invisible="1"/>
|
||||
</group>
|
||||
<group colspan='2' col='2'>
|
||||
<separator string="Cost / Revenue" colspan="4"/>
|
||||
<field name="variable_cost"/>
|
||||
<field name="revenue"/>
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<separator string="Action" colspan="4"/>
|
||||
<group colspan='4' col='2'>
|
||||
<separator string="Condition" colspan="4"/>
|
||||
<field name="condition" widget="char" colspan="2"/>
|
||||
<field name="keep_if_condition_not_met"/>
|
||||
</group>
|
||||
<group colspan='4' col='4'>
|
||||
<group colspan="4" col="6">
|
||||
<field name="condition" colspan="5" widget="char"/>
|
||||
<group col='2'>
|
||||
<field name="keep_if_condition_not_met" />
|
||||
</group>
|
||||
</group>
|
||||
<field name="type" width='100'/>
|
||||
<separator string="Action" colspan="4"/>
|
||||
<field name="type"/>
|
||||
<group colspan='2' col='1'>
|
||||
<field name="email_template_id" attrs="{'required':[('type','=','email')], 'invisible':[('type','!=','email')]}"
|
||||
context="{'default_object_name':object_id}" />
|
||||
<group attrs="{'invisible':[('type','!=','paper')]}" >
|
||||
<field name="report_id" attrs="{'required':[('type','=','paper')]}" context="{'object_id':object_id}"/>
|
||||
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
|
||||
<group attrs="{'invisible':[('type','!=','report')]}" >
|
||||
<field name="report_id" attrs="{'required':[('type','=','report')]}" context="{'object_id':object_id}"/>
|
||||
<field name="report_directory_id" attrs="{'required':[('type','=','report')]}" />
|
||||
</group>
|
||||
<field name="server_action_id" attrs="{'required':[('type','=','action')],'invisible':[('type','!=','action')]}" domain="[('model_id','=',object_id)]" />
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<group colspan="4" col="2" expand="1">
|
||||
<group colspan="4" col="2">
|
||||
<separator string="Transitions" colspan="2"/>
|
||||
<field name="from_ids" nolabel="1" mode="tree,form" default_get="{'default_activity_to_id': active_id}">
|
||||
<tree string="Incoming Transitions" editable="bottom">
|
||||
@@ -296,9 +313,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Activities">
|
||||
<field name="name" select="1"/>
|
||||
<field name="start"/>
|
||||
<field name="condition"/>
|
||||
<field name="type"/>
|
||||
<field name="start"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -322,6 +339,7 @@
|
||||
<field name="partner_id"/>
|
||||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
<field name="res_id" invisible="1"/>
|
||||
<button string="Preview" states="todo" name="preview" icon="gtk-zoom-fit" type="object"/>
|
||||
<button string="Process" states="todo" name="process" type="object" icon="terp-gtk-go-back-rtl"/>
|
||||
<button string="Cancel" states="todo" name="button_cancel" type="object" icon="terp-gtk-stop"/>
|
||||
@@ -375,17 +393,21 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Marketing Campaign Activities">
|
||||
<filter icon="terp-gtk-go-back-rtl" string="To Do" name = "todo" domain="[('state','=','todo')]"/>
|
||||
<filter icon="terp-go-today" string="Today" name="today" domain="[('date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" string="To Do" name="todo" domain="[('state','=','todo')]"/>
|
||||
<filter icon="terp-emblem-important" string="Exception" domain="[('state','=','exception')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="segment_id" select="1"/>
|
||||
<field name="object_id" select="1"/>
|
||||
<field name="res_name" select="1"/>
|
||||
<field name="res_id" select="1"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Segment" name="Segment" icon="terp-stock_symbol-selection" context="{'group_by':'segment_id'}" />
|
||||
<filter string="Activity" name="Activity" icon="terp-stock_align_left_24" context="{'group_by':'activity_id'}" />
|
||||
<!--filter string="Campaign" name="campaign" icon="terp-gtk-jump-to-rtl" context="{'group_by':'campaign_id'}" /-->
|
||||
<filter string="Segment" name="segment" icon="terp-stock_symbol-selection" context="{'group_by':'segment_id'}" />
|
||||
<filter string="Activity" name="activity" icon="terp-stock_align_left_24" context="{'group_by':'activity_id'}" />
|
||||
<filter string="Resource" name="resource" icon="terp-accessories-archiver" context="{'group_by':'res_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" name="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}" />
|
||||
<separator orientation="vertical"/>
|
||||
@@ -417,5 +439,19 @@
|
||||
domain="[('campaign_id','=',active_id)]"
|
||||
/>
|
||||
|
||||
<!-- Campaign Followups -->
|
||||
<act_window domain="[('campaign_id', '=', active_id)]"
|
||||
id="act_marketing_campaing_followup"
|
||||
name="Campaign Follow-ups" res_model="marketing.campaign.workitem"
|
||||
src_model="marketing.campaign" view_mode="tree,form"
|
||||
view_type="form" />
|
||||
|
||||
<!-- Campaign Statistics -->
|
||||
<act_window domain="[('campaign_id', '=', active_id)]"
|
||||
id="act_marketing_campaing_stat"
|
||||
name="Campaign Statistics" res_model="campaign.analysis"
|
||||
src_model="marketing.campaign" view_mode="tree,form"
|
||||
view_type="form" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -38,10 +38,11 @@ class campaign_analysis(osv.osv):
|
||||
wi_ids = self.pool.get('marketing.campaign.workitem').search(cr, uid,
|
||||
[('segment_id.campaign_id', '=', ca_obj.campaign_id.id)])
|
||||
total_cost = ca_obj.activity_id.variable_cost + \
|
||||
(ca_obj.campaign_id.fixed_cost / len(wi_ids))
|
||||
((ca_obj.campaign_id.fixed_cost or 0.00) / len(wi_ids))
|
||||
result[ca_obj.id] = total_cost
|
||||
return result
|
||||
_columns = {
|
||||
'res_id' : fields.integer('Resource', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'),
|
||||
('03','March'), ('04','April'),('05','May'), ('06','June'),
|
||||
@@ -69,6 +70,7 @@ class campaign_analysis(osv.osv):
|
||||
create or replace view campaign_analysis as (
|
||||
select
|
||||
min(wi.id) as id,
|
||||
min(wi.res_id) as res_id,
|
||||
to_char(wi.date::date, 'YYYY') as year,
|
||||
to_char(wi.date::date, 'MM') as month,
|
||||
wi.date::date as date,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<field name="segment_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="country_id" invisible="1"/>
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="count"/>
|
||||
<field name="total_cost" string="Cost"/><!-- sum="Cost"/-->
|
||||
<field name="revenue"/>
|
||||
@@ -35,7 +36,7 @@
|
||||
<filter icon="terp-go-month"
|
||||
string="This Month"
|
||||
domain="[('month','=',time.strftime('%%m'))]"/>
|
||||
<filter icon="terp-go-month"
|
||||
<filter icon="terp-go-today"
|
||||
string="Today"
|
||||
domain="[('date','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -59,7 +60,9 @@
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Campaign" name="Campaign" icon="terp-gtk-jump-to-rtl" context="{'group_by':'campaign_id'}" />
|
||||
<filter string="Segment" name ="Segment" icon="terp-stock_symbol-selection" context="{'group_by':'segment_id'}" />
|
||||
<filter string="State" icon="terp-stock_symbol-selection" context="{'group_by':'state'}"/>
|
||||
<filter string="Activity" name ="activity" icon="terp-stock_align_left_24" context="{'group_by':'activity_id'}" />
|
||||
<filter string="Resource" icon="terp-accessories-archiver" context="{'group_by':'res_id'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
<field name="server_action_id" ref="action_dummy"/>
|
||||
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
|
||||
<field name="report_directory_id" ref="document_directory_campaign1"/>
|
||||
<field name="type">paper</field>
|
||||
<field name="type">report</field>
|
||||
<field eval="1" name="start"/>
|
||||
<field name="report_id" ref="mc_crm_lead_demo_report"/>
|
||||
</record>
|
||||
@@ -220,7 +220,7 @@
|
||||
<field name="server_action_id" ref="action_dummy"/>
|
||||
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
|
||||
<field name="report_directory_id" ref="document_directory_campaign1"/>
|
||||
<field name="type">paper</field>
|
||||
<field name="type">report</field>
|
||||
<field name="report_id" ref="mc_crm_lead_demo_report"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
"depends" : ['marketing_campaign'],
|
||||
"author" : "OpenERP SA",
|
||||
"category": 'Generic Modules/Marketing',
|
||||
"description": """
|
||||
""",
|
||||
"description": """
|
||||
This module provides integration of the mailchimp.com marketing campaign and mailing-list service, connecting via Mailchimp's WebServices API.
|
||||
You can define multiple Mailchimp accounts and then use them as you wish through a new type of activity, providing direct connection to your Mailchimp Lists.""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
"security/ir.model.access.csv",
|
||||
'marketing_campaign_mailchimp_view.xml',
|
||||
'wizard/create_list_view.xml',
|
||||
],
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
-->
|
||||
|
||||
<menuitem name="Tools" id="base.menu_tools" icon="STOCK_PREFERENCES" sequence="28"/>
|
||||
<menuitem name="Mailchimps" id="menu_action_mailchimp" parent="base.menu_emails" />
|
||||
<menuitem name="Mailchimp" id="menu_action_mailchimp" parent="base.menu_emails" />
|
||||
|
||||
<record model="ir.ui.view" id="view_mailchimp_account_tree">
|
||||
<field name="name">mailchimp.account.tree</field>
|
||||
<field name="model">mailchimp.account</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');black:state in ('approved');gray:state in ('cancelled')" string="All Accounts">
|
||||
<tree colors="blue:state in ('draft');black:state in ('approved');gray:state in ('cancelled')" string="Accounts">
|
||||
<field name="name"/>
|
||||
<field name="username" />
|
||||
<field name="data_center"/>
|
||||
@@ -70,7 +70,7 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_mailchimp_account">
|
||||
<field name="name">All Mailchimp Accounts</field>
|
||||
<field name="name">Mailchimp Accounts</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mailchimp.account</field>
|
||||
<field name="view_type">form</field>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_mailchimp_account_user","mailchimp.account.user","marketing_campaign_mailchimp.model_mailchimp_account","base.res_groups_email_template_admin",1,1,1,1
|
||||
"access_mailchimp_account_system","mailchimp.account.user","marketing_campaign_mailchimp.model_mailchimp_account","base.groups_system",1,0,0,0
|
||||
"access_email_template_account_system","email_template_account_user","marketing_campaign_mailchimp.model_email_template_account","base.res_groups_email_template_admin",1,1,1,1
|
||||
"access_email_template_campaign","email_template_campaign","model_email_template","base.res_groups_email_template_admin",1,1,1,1
|
||||
"access_mailchimp_account_system","mailchimp.account.user","marketing_campaign_mailchimp.model_mailchimp_account","base.res_groups_email_template_admin",1,0,0,0
|
||||
"access_mailchimp_account_user","mailchimp_account_user","model_mailchimp_account","base.res_groups_email_template_admin",1,1,1,1
|
||||
|
||||
|
@@ -5,7 +5,8 @@
|
||||
<field name="model">create.list</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Update List">
|
||||
<form string="Update List Manually">
|
||||
<separator string="Update List Manually" colspan="4"/>
|
||||
<field name="mailchimp_account_id" on_change = "onchange_mailchimp_account_id(mailchimp_account_id,action)"/>
|
||||
<field name="list_name" />
|
||||
<newline/>
|
||||
@@ -19,14 +20,18 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_create_list" model="ir.actions.act_window">
|
||||
<field name="name">Update List</field>
|
||||
<field name="name">Manual Mailchimp List Update</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">create.list</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_create_list"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem id="menu_action_mailchimp_create_list" parent="menu_action_mailchimp" action="action_create_list" sequence="40"/>
|
||||
|
||||
<menuitem id="menu_action_mailchimp_create_list"
|
||||
name="Manual Mailchimp List Update"
|
||||
parent="menu_action_mailchimp" action="action_create_list"
|
||||
sequence="40" />
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem icon="terp-mrp" id="base.menu_mrp_root" name="Manufacturing"
|
||||
<menuitem icon="terp-mrp" id="base.menu_mrp_root" parent="" name="Manufacturing"
|
||||
groups="group_mrp_user,group_mrp_manager,base.group_system" sequence="8"/>
|
||||
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
|
||||
|
||||
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
|
||||
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
|
||||
<menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
|
||||
|
||||
@@ -910,7 +911,6 @@
|
||||
src_model="product.product"/>
|
||||
|
||||
<!-- Menu for Resource for MRP-->
|
||||
<menuitem icon="terp-mrp" id="base.menu_mrp_root" name="Manufacturing" groups="mrp.group_mrp_user" sequence="3" />
|
||||
|
||||
<menuitem id="menu_pm_resources_mrp" name="Resources" parent="base.menu_mrp_root"
|
||||
groups="base.group_extended"
|
||||
|
||||
@@ -24,6 +24,7 @@ import decimal_precision as dp
|
||||
import pooler
|
||||
|
||||
import math
|
||||
import logging
|
||||
from _common import rounding
|
||||
|
||||
from tools import config
|
||||
@@ -724,13 +725,24 @@ class res_users(osv.osv):
|
||||
_name = 'res.users'
|
||||
_inherit = 'res.users'
|
||||
|
||||
def create(self, cr, uid, data, context={}):
|
||||
def create(self, cr, uid, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
user_id = super(res_users, self).create(cr, uid, data, context)
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
try:
|
||||
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
|
||||
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
|
||||
'user_id': user_id}, context=context)
|
||||
except ValueError:
|
||||
# During a single install of multiple modules, the product_view.xml may
|
||||
# be loaded after this python code is present in the server and called
|
||||
# by other module's res_users.create() calls. So, we have to survive
|
||||
# this and create the user.
|
||||
# One more case is if some admin has deliberately removed this shortcut,
|
||||
# users must still be able to create.
|
||||
logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','<new'))
|
||||
return user_id
|
||||
|
||||
res_users()
|
||||
|
||||
@@ -81,14 +81,7 @@
|
||||
|
||||
<!--Actions for deshboard -->
|
||||
|
||||
<record id="action_view_project_editable_messages_tree" model="ir.actions.act_window">
|
||||
<field name="name">Messages</field>
|
||||
<field name="res_model">project.message</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="project.view_project_message_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="board_project_form" model="ir.ui.view">
|
||||
<field name="name">board.project.form</field>
|
||||
<field name="model">board.board</field>
|
||||
|
||||
@@ -764,32 +764,6 @@ class config_compute_remaining(osv.osv_memory):
|
||||
|
||||
config_compute_remaining()
|
||||
|
||||
class message(osv.osv):
|
||||
_name = "project.message"
|
||||
_description = "Message"
|
||||
|
||||
_columns = {
|
||||
'subject': fields.char('Subject', size=128, required="True"),
|
||||
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
|
||||
'date': fields.date('Date', required=1),
|
||||
'user_id': fields.many2one('res.users', 'User', required="True"),
|
||||
'description': fields.text('Description'),
|
||||
}
|
||||
|
||||
def _default_project(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if 'project_id' in context and context['project_id']:
|
||||
return int(context['project_id'])
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
'user_id': lambda self,cr,uid,ctx: uid,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'project_id': _default_project
|
||||
}
|
||||
|
||||
message()
|
||||
class account_analytic_account(osv.osv):
|
||||
|
||||
_inherit = 'account.analytic.account'
|
||||
|
||||
@@ -254,15 +254,7 @@
|
||||
<field name="project_id" ref="project_project_22"/>
|
||||
<field name="name">Latest in house tests</field>
|
||||
</record>
|
||||
<record id="project_message_1" model="project.message">
|
||||
<field name="project_id" ref="project.project_project_23"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="description">Follow the procedure of Configuration wizard.
|
||||
- Add all required modules
|
||||
- Add chat of accounts
|
||||
- Create Users</field>
|
||||
<field name="subject">Configuration steps</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
</group>
|
||||
<newline />
|
||||
<group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
|
||||
<filter string="User" name="Users" icon="terp-personal" domain = "[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Manager" name="Manager" icon="terp-personal" domain = "[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Partner" name="Partner" icon="terp-personal" domain = "[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Parent" name="Parent" icon="terp-folder-blue" domain = "[]" context="{'group_by':'parent_id'}"/>
|
||||
@@ -200,7 +200,7 @@
|
||||
<field name="remaining_hours" widget="float_time"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-close" special="cancel" string="Close"/>
|
||||
<button icon="gtk-apply" name="compute_hours" string="Update" type="object" default_focus="1"/>
|
||||
</group>
|
||||
</form>
|
||||
@@ -421,7 +421,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Project" name="group_project_id" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Stages" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="State" name="group_state" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
|
||||
@@ -564,82 +564,7 @@ Issues like bugs in a system, client complain, materials breakdown are collected
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--- Messages-->
|
||||
<record id="view_project_message_form" model="ir.ui.view">
|
||||
<field name="name">project.message.form</field>
|
||||
<field name="model">project.message</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Messages">
|
||||
<group colspan="6">
|
||||
<field name="subject" select="1"/>
|
||||
<field name="project_id"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_message_tree" model="ir.ui.view">
|
||||
<field name="name">project.message.tree</field>
|
||||
<field name="model">project.message</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Messages">
|
||||
<field name="date" select="1"/>
|
||||
<field name="subject" select="1"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_message_search" model="ir.ui.view">
|
||||
<field name="name">project.message.search</field>
|
||||
<field name="model">project.message</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Messages">
|
||||
<group col="20" colspan="4">
|
||||
<filter domain="[('date','>=',time.strftime('%%Y-%%m-01'))]" icon="terp-go-month" string="This Month" />
|
||||
<filter domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" icon="terp-go-today" string="Today" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="subject"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_project_messages_tree" model="ir.actions.act_window">
|
||||
<field name="name">Project Messages</field>
|
||||
<field name="res_model">project.message</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_project_message_tree"/>
|
||||
<field name="context">{"search_default_project_id":project_id, "search_default_user_id":uid}</field>
|
||||
<field name="search_view_id" ref="view_project_message_search"/>
|
||||
<field name="help">An in-project messagery system permits an efficient and trackable communication between project members. The messages are kept in the system and can then be used for post-analysis.</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_view_project_messages_tree" id="menu_message_tree" parent="menu_project_management" sequence="11"/>
|
||||
|
||||
<act_window domain="[('user_id', '=', active_id),('state', '<>', 'cancelled'),('state', '<>', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
|
||||
|
||||
<act_window domain="[('user_id', '=', active_id),('date', '>=', time.strftime('%Y-%m-01'))]" id="act_res_users_2_project_task_work_month" name="Month works" res_model="project.task.work" src_model="res.users" view_mode="tree,form" view_type="form"/>
|
||||
|
||||
<act_window domain="[('project_id', '=', active_id)]" id="act_project_messages" name="Messages" res_model="project.message" src_model="project.project"/>
|
||||
|
||||
<act_window domain="[('user_id', '=', active_id),('state', '<>', 'cancelled'),('state', '<>', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
|
||||
<act_window domain="[('user_id', '=', active_id),('date', '>=', time.strftime('%Y-%m-01'))]" id="act_res_users_2_project_task_work_month" name="Month works" res_model="project.task.work" src_model="res.users" view_mode="tree,form" view_type="form"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"access_project_task","project.task","model_project_task","project.group_project_user",1,1,1,1
|
||||
"access_project_task_work","project.task.work","model_project_task_work","project.group_project_user",1,1,1,1
|
||||
"access_project_task_work_manager","project.task.work.manager","model_project_task_work","project.group_project_manager",1,1,1,1
|
||||
"access_project_message","project.message","model_project_message","project.group_project_user",1,1,1,1
|
||||
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,1,1,1
|
||||
"access_project_vs_hours","project.vs.hours","model_project_vs_hours","project.group_project_user",1,1,1,1
|
||||
"access_task_by_days","task.by.days","model_task_by_days","project.group_project_user",1,1,1,1
|
||||
@@ -19,8 +18,6 @@
|
||||
"access_partner_address_task manager","base.res.partner.address manager","base.model_res_partner_address","project.group_project_manager",1,0,0,0
|
||||
"access_task_on_partner","project.task on partners","model_project_task","base.group_user",1,0,0,0
|
||||
"access_project_on_partner","project.project on partners","model_project_project","base.group_user",1,0,0,0
|
||||
"access_project_message_manager","project.message manager","model_project_message","project.group_project_manager",1,0,0,0
|
||||
"access_project_message_system","project.message system","model_project_message","base.group_system",1,0,0,0
|
||||
"access_project_task_system","project.task system","model_project_task","base.group_system",1,0,0,0
|
||||
"access_project_project_system","project.project system","model_project_project","base.group_system",1,1,1,1
|
||||
"access_project_task_work_system","project.task.work system","model_project_task_work","base.group_system",1,0,0,0
|
||||
|
||||
|
@@ -71,12 +71,24 @@ class project_close_task(osv.osv_memory):
|
||||
_defaults = {
|
||||
'manager_email': _get_manager_email,
|
||||
'partner_email': _get_partner_email,
|
||||
'description': _get_desc,
|
||||
}
|
||||
|
||||
def close(self, cr, uid, ids, context=None):
|
||||
data = self.read(cr,uid,ids)[0]
|
||||
notes=data['description'] or ''
|
||||
task_pool = self.pool.get('project.task')
|
||||
user_name = self.pool.get('res.users').browse(cr, uid, uid).name
|
||||
description = _("Closed By ") + user_name + _(" At ") + time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
description += "\n" + "=======================" + "\n" + notes
|
||||
if 'task_id' in context:
|
||||
self.pool.get('project.task').write(cr, uid, [context['task_id']], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
|
||||
task = task_pool.browse(cr, uid, context['task_id'])
|
||||
description = task.description and task.description + "\n\n" + description
|
||||
task_pool.write(cr, uid, [task.id], {
|
||||
'description': description,
|
||||
'state': 'done',
|
||||
'date_end':time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'remaining_hours': 0.0
|
||||
})
|
||||
return {}
|
||||
|
||||
def confirm(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Project Close Task" >
|
||||
<label string="Send mail to the specified email address"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<separator string="Send mail to the specified email address" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<newline/>
|
||||
<field name="manager_email" invisible="not context.get('send_manager',False)"/>
|
||||
<newline/>
|
||||
<field name="partner_email" invisible="not context.get('send_partner',False)"/>
|
||||
<newline/>
|
||||
<field name="description" />
|
||||
<separator string="Remark" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
<separator string="" colspan="6"/>
|
||||
<group colspan="6" col="6">
|
||||
<button icon="gtk-ok" name="confirm" string="Send and Close" type="object"/>
|
||||
<button icon="gtk-ok" string="Close" name="close" type="object"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
|
||||
<button icon="gtk-close" name="confirm" string="Close" type="object"/>
|
||||
<button icon="gtk-jump-to" string="Done" name="close" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,24 +8,21 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Project Task Delegate">
|
||||
<separator string="Delegated Task" colspan="4"/>
|
||||
<field name="user_id"/>
|
||||
<newline/>
|
||||
<field name="planned_hours" widget="float_time"/>
|
||||
<newline/>
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="new_task_description"/>
|
||||
<newline/>
|
||||
<separator string="Validation Task" colspan="4"/>
|
||||
<field name="planned_hours_me" widget="float_time"/>
|
||||
<newline/>
|
||||
<field name="prefix" />
|
||||
<newline/>
|
||||
<field name="state" />
|
||||
<newline/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Delegated Task" colspan="4"/>
|
||||
<field name="user_id" colspan="4"/>
|
||||
<field name="planned_hours" widget="float_time" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="new_task_description" colspan="4" />
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Validation Task" colspan="4"/>
|
||||
<field name="planned_hours_me" widget="float_time" colspan="4"/>
|
||||
<field name="prefix" colspan="4"/>
|
||||
<field name="state" colspan="4"/>
|
||||
</group>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
|
||||
<button icon="gtk-close" special="cancel" string="Close"/>
|
||||
<button icon="gtk-ok" name="validate" string="Approve" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
|
||||
import purchase_requisition
|
||||
import wizard
|
||||
import report
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["wizard/purchase_requisition_partner_view.xml",
|
||||
"purchase_requisition_data.xml",
|
||||
"purchase_requisition_view.xml",
|
||||
"purchase_requisition_report.xml",
|
||||
"security/ir.model.access.csv","purchase_requisition_sequence.xml"
|
||||
],
|
||||
"active": False,
|
||||
|
||||
@@ -40,6 +40,7 @@ class purchase_requisition(osv.osv):
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders',states={'done': [('readonly', True)]}),
|
||||
'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase',states={'done': [('readonly', True)]}),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
|
||||
'state': fields.selection([('draft','Draft'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
|
||||
}
|
||||
_defaults = {
|
||||
@@ -51,6 +52,15 @@ class purchase_requisition(osv.osv):
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order.requisition'),
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None,context={}):
|
||||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'state':'draft',
|
||||
'purchase_ids':[],
|
||||
'name': self.pool.get('ir.sequence').get(cr, uid, 'purchase.order.requisition'),
|
||||
})
|
||||
return super(purchase_requisition, self).copy(cr, uid, id, default, context)
|
||||
def tender_cancel(self, cr, uid, ids, context=None):
|
||||
purchase_order_obj = self.pool.get('purchase.order')
|
||||
for purchase in self.browse(cr, uid, ids):
|
||||
@@ -64,9 +74,6 @@ class purchase_requisition(osv.osv):
|
||||
return True
|
||||
|
||||
def tender_in_progress(self, cr, uid, ids, context=None):
|
||||
for quotations in self.browse(cr, uid, ids):
|
||||
if not quotations.purchase_ids:
|
||||
raise osv.except_osv(_('Purchase order required'),('You should have atleast one purchase order line defined for this tender'))
|
||||
self.write(cr, uid, ids, {'state':'in_progress'} ,context=context)
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Tender') + " '" + name + "' "+ _(" is In Progress")
|
||||
@@ -172,6 +179,8 @@ class procurement_order(osv.osv):
|
||||
'name': sequence_obj.get(cr, uid, 'purchase.order.requisition'),
|
||||
'origin': procurement.name,
|
||||
'date_end': procurement.date_planned,
|
||||
'warehouse_id':procurement.purchase_id and procurement.purchase_id.warehouse_id.id,
|
||||
'company_id':procurement.company_id.id,
|
||||
'line_ids': [(0,0,{
|
||||
'product_id': procurement.product_id.id,
|
||||
'product_uom_id': procurement.product_uom.id,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<function
|
||||
eval="('default',False,'warehouse_id', [('purchase.requisition', False)], ref('stock.warehouse0'), True, False, False, False, True)"
|
||||
id="purchase_default_set"
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<report auto="False" id="report_purchase_requisition" model="purchase.requisition" name="purchase.requisition" rml="purchase_requisition/report/purchase_requisition.rml" string="Purchase Requisition"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -2,17 +2,6 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="purchase_order_tree_inherit">
|
||||
<field name="name">purchase.order.tree.inherit</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.purchase_order_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="requisition_id" groups="base.group_extended"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="purchase_order_form_inherit">
|
||||
<field name="name">purchase.order.form.inherit</field>
|
||||
@@ -20,12 +9,23 @@
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_ref" position="after">
|
||||
<field name="shipped" position="after">
|
||||
<field name="requisition_id" groups="base.group_extended"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="purchase_order_search_inherit">
|
||||
<field name="name">purchase.order.list.select.inherit</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/search/group/filter[@string='To Invoice']" position="after">
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" separator="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_purchase_requisition_form">
|
||||
<field name="name">purchase.requisition.form</field>
|
||||
<field name="type">form</field>
|
||||
@@ -39,6 +39,7 @@
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="origin"/>
|
||||
<field name="warehouse_id" groups="base.group_extended" widget="selection"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
@@ -77,12 +78,15 @@
|
||||
<field name="minimum_planned_date"/>
|
||||
<field name="origin"/>
|
||||
<field name="state"/>
|
||||
<button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
|
||||
<button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
|
||||
<button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>
|
||||
</tree>
|
||||
</field>
|
||||
<separator colspan="4" string=""/>
|
||||
<group col="8" colspan="4">
|
||||
<label colspan="6" string=""/>
|
||||
<button name="%(action_purchase_requisition_partner)d" string="Requests for Quotation" type="action" icon="gtk-execute"
|
||||
<button name="%(action_purchase_requisition_partner)d" string="Request a Quotation" type="action" icon="gtk-execute"
|
||||
attrs="{'readonly': [('state', '=', 'done')]}" />
|
||||
</group>
|
||||
</page>
|
||||
@@ -123,6 +127,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id" />
|
||||
<filter icon="terp-personal-" string="Unassigned" domain="[('user_id','=', False)]" help="Unassigned Requisition"/>
|
||||
<field name="exclusive" />
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -181,5 +186,12 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<act_window
|
||||
domain="[('requisition_id', '=', active_id)]"
|
||||
id="act_res_partner_2_purchase_order"
|
||||
name="Purchase orders"
|
||||
res_model="purchase.order"
|
||||
src_model="purchase.requisition"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import requisition
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,2" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,2" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,2" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0" textColor="#008000"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
|
||||
<paraStyle name="terp_default_Note" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Table" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_left" fontName="Helvetica-Bold" fontSize="10.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="terp_header_Centre">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'requisition') ]]</para>
|
||||
<para style="P3">Purchase for Requisitions [[ requisition.name ]]</para>
|
||||
<para style="terp_header_Centre">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="159.0,159.0,106.0,106.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Requisition Reference</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Requisition Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Type</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ requisition.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ requisition.date_start ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ requisition.exclusive=='multiple' and 'Multiple Requisitions' or requisition.exclusive=='exclusive' and 'Purchase Requisitions (exclusive)' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ requisition.origin ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_Centre_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Centre_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_header_left">Product Detail</para>
|
||||
<blockTable colWidths="177.0,177.0,177.0" style="Table2">[[ requisition.line_ids or removeParentNode('section') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Qty</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Product UoM</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><para style="terp_default_8">[[ repeatIn(requisition.line_ids,'line_ids') ]]</para>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ line_ids.product_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ line_ids.product_qty ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ line_ids.product_uom_id.category_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="terp_default_Centre_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Centre_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_header_left">Quotation Detail</para>
|
||||
<blockTable colWidths="133.0,163.0,235.0" style="Table3">[[ requisition.purchase_ids or removeParentNode('section') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Order Reference</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Date Ordered</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Supplier</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><para style="P2">[[ repeatIn(requisition.purchase_ids,'purchase_ids') ]]</para>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ purchase_ids.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ purchase_ids.date_order ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ purchase_ids.partner_address_id.partner_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from osv import osv
|
||||
import pooler
|
||||
|
||||
class requisition(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(requisition, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.purchase.requisition','purchase.requisition','addons/purchase_requisition/report/purchase_requisition.rml',parser=requisition)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -92,7 +92,7 @@ class purchase_requisition_partner(osv.osv_memory):
|
||||
pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id or False
|
||||
price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
|
||||
product = prod_obj.browse(cr, uid, line.product_id.id, context=context)
|
||||
|
||||
location_id = self.pool.get('stock.warehouse').read(cr, uid, [tender.warehouse_id.id], ['lot_input_id'])[0]['lot_input_id'][0]
|
||||
|
||||
purchase_order_line= {
|
||||
'name': product.partner_ref,
|
||||
@@ -118,6 +118,10 @@ class purchase_requisition_partner(osv.osv_memory):
|
||||
'company_id': tender.company_id.id,
|
||||
'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,
|
||||
'requisition_id':tender.id,
|
||||
'notes':tender.description,
|
||||
'warehouse_id':tender.warehouse_id.id and tender.warehouse_id.id ,
|
||||
'location_id':location_id,
|
||||
'company_id':tender.company_id.id,
|
||||
})
|
||||
order_ids=[]
|
||||
for order_line in list_line:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
|
||||
<button icon="gtk-ok" name="create_order" string="Create Orders" type="object"/>
|
||||
<button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user