bzr revid: uco@tinyerp.com-20100913044316-qogqz4818rs966yz
This commit is contained in:
uco (Open ERP)
2010-09-13 10:13:16 +05:30
28 changed files with 312 additions and 219 deletions
+6
View File
@@ -109,6 +109,8 @@
<field name="base_amount"/>
<field name="tax_code_id"/>
<field name="tax_amount"/>
<field name="factor_base" invisible="True"/>
<field name="factor_tax" invisible="True"/>
</form>
</field>
</record>
@@ -194,6 +196,8 @@
<field invisible="True" name="base_amount"/>
<field invisible="True" name="tax_amount"/>
<field name="factor_base" invisible="True"/>
<field name="factor_tax" invisible="True"/>
</tree>
</field>
</group>
@@ -286,6 +290,8 @@
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
<field invisible="True" name="base_amount"/>
<field invisible="True" name="tax_amount"/>
<field name="factor_base" invisible="True"/>
<field name="factor_tax" invisible="True"/>
</tree>
</field>
</group>
+27 -8
View File
@@ -1471,6 +1471,24 @@ account_invoice_line()
class account_invoice_tax(osv.osv):
_name = "account.invoice.tax"
_description = "Invoice Tax"
def _count_factor(self, cr, uid, ids, name, args, context=None):
res = {}
for invoice_tax in self.browse(cr, uid, ids, context=context):
res[invoice_tax.id] = {
'factor_base': 1.0,
'factor_tax': 1.0,
}
if invoice_tax.amount <> 0.0:
factor_tax = invoice_tax.tax_amount / invoice_tax.amount
res[invoice_tax.id]['factor_tax'] = factor_tax
if invoice_tax.base <> 0.0:
factor_base = invoice_tax.base_amount / invoice_tax.base
res[invoice_tax.id]['factor_base'] = factor_base
return res
_columns = {
'invoice_id': fields.many2one('account.invoice', 'Invoice Line', ondelete='cascade', select=True),
'name': fields.char('Tax Description', size=64, required=True),
@@ -1485,33 +1503,34 @@ class account_invoice_tax(osv.osv):
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."),
'tax_amount': fields.float('Tax Code Amount', digits_compute=dp.get_precision('Account')),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True),
'factor_base' : fields.function(_count_factor, method=True, string='Multipication factor for Base code', type='float', multi="all"),
'factor_tax' : fields.function(_count_factor, method=True, string='Multipication factor Tax code', type='float', multi="all")
}
def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency = False
factor = 1
if ids:
factor = self.read(cr, uid, ids[0], ['factor_base'])['factor_base']
if company_id:
company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0]
if currency_id and company_currency:
base = cur_obj.compute(cr, uid, currency_id, company_currency, base, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
base = cur_obj.compute(cr, uid, currency_id, company_currency, base*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
return {'value': {'base_amount':base}}
def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency = False
tax_sign = 1
factor = 1
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
factor = self.read(cr, uid, ids[0], ['factor_tax'])['factor_tax']
if company_id:
company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0]
if currency_id and company_currency:
amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*tax_sign, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
return {'value': {'tax_amount': amount}}
_order = 'sequence'
@@ -8,5 +8,14 @@
name="account.invoice.layout"
rml="account_invoice_layout/report/report_account_invoice_layout.rml"
auto="False"/>
<report id="account_invoices_layout_message"
menu="False"
string="Invoices with Layout and Message"
model="account.invoice"
name="notify_account.invoice"
rml="account_invoice_layout/report/special_message_invoice.rml"
auto="False"/>
</data>
</openerp>
+2
View File
@@ -186,6 +186,8 @@ def map_data(cr, uid, obj, context=None):
if field_type == 'selection':
if not map_val:
continue
if type(map_val) == list and len(map_val): #TOFIX: why need to check this
map_val = map_val[0]
mapping = obj.__attribute__[map_dict].get('mapping', False)
if mapping:
map_val = mapping.get(map_val.lower(), False)
+2 -2
View File
@@ -119,7 +119,7 @@ class crm_lead(crm_case, osv.osv):
'write_date': fields.datetime('Update Date' , readonly=True),
# Lead fields
'categ_id': fields.many2one('crm.case.categ', 'Lead Source', \
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type', \
@@ -148,7 +148,7 @@ class crm_lead(crm_case, osv.osv):
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)], readonly=True),
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
'partner_assigned_id': fields.many2one('res.partner', 'Assigned Partner', help="Partner this case has been forwarded/assigned to.", select=True),
'date_assign': fields.date('Assignation Date', help="Last date this case was forwarded/assigned to a partner"),
}
+5 -8
View File
@@ -57,6 +57,9 @@
<group colspan="4" col="7">
<field name="name" required="1" string="Name"/>
<field name="priority"/>
<field name="categ_id"
widget="selection"
domain="[('object_id.model','=','crm.lead')]"/>
<button
name="convert_opportunity"
string="Convert to Opportunity"
@@ -71,10 +74,10 @@
domain="[('section_id','=',section_id), ('object_id.model', '=', 'crm.lead')]" />
<group col="2" colspan="1">
<button name="stage_previous" string="Previous"
states="open,pending" type="object"
states="open,pending,draft" type="object"
icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
states="open,pending,draft" type="object"
icon="gtk-go-forward" />
</group>
<field name="type" invisible="1"/>
@@ -144,9 +147,6 @@
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2" />
<field name="categ_id"
widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
<field name="type_id" string="Campaign" select="1"/>
<field name="referred"/>
</group>
@@ -265,9 +265,6 @@
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
icon="gtk-go-up" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
</record>
+8 -13
View File
@@ -36,8 +36,6 @@
<field name="date_action"/>
<field name="title_action"/>
<field name="priority" string="Priority"/>
<button string="Merge with other Opportunity"
name="%(merge_opportunity_act)d" icon="gtk-add" type="action" />
<newline/>
<field name="type" invisible="1"/>
</group>
@@ -55,9 +53,9 @@
attrs="{'invisible':[('partner_id','!=',False)]}"/>
</group>
<field name="partner_address_id"
string="Contact"
on_change="onchange_partner_address_id(partner_address_id, email_from)"
colspan="1" />
string="Contact"
on_change="onchange_partner_address_id(partner_address_id, email_from)"
colspan="1" />
<field name="email_from" string="Email" />
<field name="phone"/>
</group>
@@ -142,9 +140,9 @@
<group col="4" colspan="4">
<field name="email_from"/>
<field name="date"/>
<field name="email_to" widget="char" size="512"/>
<field name="email_cc" widget="char" size="512"/>
<field name="name" colspan="4" widget="char" size="512"/>
<field name="email_to" size="512"/>
<field name="email_cc" size="512"/>
<field name="name" colspan="4"/>
<field name="history" invisible="1"/>
</group>
<notebook colspan="4">
@@ -236,7 +234,7 @@
<button name="stage_next" string="Next Stage"
states="open,pending" type="object"
icon="gtk-go-forward" />
<field name="planned_revenue" sum="Total of Planned Revenue"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
<field name="section_id"
invisible="context.get('invisible_section', True)" />
@@ -250,9 +248,6 @@
<button name="case_pending" string="Pending"
states="open,draft" type="object"
icon="gtk-media-pause" />
<button name="case_mark_lost" string="Lost"
states="open,pending" type="object"
icon="gtk-cancel" />
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
@@ -303,12 +298,12 @@
/>
<separator orientation="vertical"/>
<field name="name" string="Opportunity"/>
<field name="partner_id"/>
<field name="user_id">
<filter icon="terp-personal-"
domain="[('user_id','=', False)]"
help="Unassigned Opportunities" />
</field>
<field name="email_from"/>
<field name="section_id"
default="context.get('section_id', False)"
context="{'invisible_section': False}"
+16 -7
View File
@@ -186,10 +186,9 @@ This is useful for CRM leads for example"),
help="the signature from the User details"
" will be appended to the mail"),
'file_name':fields.char(
'File Name Pattern',
'Report Filename',
size=200,
help="File name pattern can be specified with placeholders."
"eg. 2009_SO003.pdf",
help="Name of the generated report file. Placeholders can be used in the filename. eg: 2009_SO003.pdf",
translate=True),
'report_template':fields.many2one(
'ir.actions.report.xml',
@@ -646,8 +645,8 @@ This is useful for CRM leads for example"),
# 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
elif template['track_campaign_item']:
# get appropriate message-id
mailbox_values.update({'message_id': tools.misc.generate_tracking_message_id(record_id)})
if not mailbox_values['account_id']:
@@ -734,7 +733,7 @@ class email_template_preview(osv.osv_memory):
context = {}
#Fills up the selection box which allows records from the selected object to be displayed
self.context = context
if 'template_id' in context.keys():
if 'template_id' in context:
ref_obj_id = self.pool.get('email.template').read(cr, uid, context['template_id'], ['object_name'], context)
ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id['object_name'][0], ['model'], context)['model']
model_obj = self.pool.get(ref_obj_name)
@@ -746,6 +745,16 @@ class email_template_preview(osv.osv_memory):
ref_obj_ids.insert(0, default_id)
return model_obj.name_get(cr, uid, ref_obj_ids, context)
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
result = super(email_template_preview, self).default_get(cr, uid, fields, context=context)
if (not fields or 'rel_model_ref' in fields) and 'template_id' in context \
and not result.get('rel_model_ref'):
selectables = self._get_model_recs(cr, uid, context=context)
result['rel_model_ref'] = selectables and selectables[0][0] or False
return result
def _default_model(self, cursor, user, context=None):
"""
Returns the default value for model field
@@ -786,7 +795,7 @@ class email_template_preview(osv.osv_memory):
}
_defaults = {
'ref_template': lambda self, cr, uid, ctx:ctx['template_id'],
'rel_model': _default_model
'rel_model': _default_model,
}
def on_change_ref(self, cr, uid, ids, rel_model_ref, context=None):
if context is None:
@@ -92,15 +92,15 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
'email_id': fields.char('From Email',
size=120, required=True,
readonly=True, states={'draft':[('readonly', False)]} ,
help="eg: yourname@yourdomain.com "),
help="eg: 'john@doe.com' or 'John Doe <john@doe.com>'"),
'smtpserver': fields.char('Server',
size=120, required=True,
readonly=True, states={'draft':[('readonly', False)]},
help="Enter name of outgoing server, eg:smtp.gmail.com "),
'smtpport': fields.integer('SMTP Port ',
help="Enter name of outgoing server, eg: smtp.yourdomain.com"),
'smtpport': fields.integer('SMTP Port',
size=64, required=True,
readonly=True, states={'draft':[('readonly', False)]},
help="Enter port number,eg:SMTP-587 "),
help="Enter port number, eg: 25 or 587"),
'smtpuname': fields.char('User Name',
size=120, required=False,
readonly=True, states={'draft':[('readonly', False)]},
@@ -20,12 +20,12 @@
<separator string="Server Information" colspan="4" />
<group colspan="4" col="4">
<field name="smtpserver" select="1"/>
<button name="check_outgoing_connection" type="object" string="Test Outgoing Connection" icon="gtk-network" colspan="2"/>
<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" icon="gtk-network"/>
<separator string="User Information" colspan="4" />
<group col="2" colspan="2">
<field name="email_id" select="1" colspan="2" />
@@ -55,14 +55,15 @@
<field name="model">email_template.account</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('suspended','approved')" string="SMTP Server">
<field name="name" select="2" />
<field name="email_id" select="2" />
<field name="smtpuname" select="2" />
<field name="user" select="2" />
<field name="smtpserver" select="2" />
<field name="smtpport" select="2" />
<field name="state" select="2" />
<tree colors="blue:state in ('draft');black:state in ('suspended','approved')" string="Email Accounts">
<field name="name" />
<field name="email_id" />
<field name="smtpuname" />
<field name="user" />
<field name="smtpserver" />
<field name="smtpport" />
<field name="auto_delete" />
<field name="state" />
</tree>
</field>
</record>
@@ -72,7 +73,7 @@
<field name="model">email_template.account</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Accounts">
<search string="Email Accounts">
<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')]"/>
@@ -89,7 +89,7 @@
<field name="email_from"/>
<field name="user">
<filter icon="terp-personal"
string="My Emails" name="myemails"
string="My Emails" help="My Emails" name="myemails"
domain="[('account_id.user','=', uid)]" />
</field>
<newline/>
+27 -18
View File
@@ -133,9 +133,9 @@
<field name="attachment_ids" colspan="4" nolabel="1" height="350"/>
</page>
<page string="Report">
<field name="file_name" colspan="4" />
<field name="report_template" colspan="4"
domain="[('model','=',model_int_name)]" />
<field name="file_name" colspan="4" />
</page>
</notebook>
</group>
@@ -151,15 +151,17 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Email Templates">
<field name="name" select="1" />
<field name="object_name" required="1" select="1" />
<field name="def_to" colspan="4" select="2" />
<field name="def_cc" colspan="4" select="2" />
<field name="def_bcc" colspan="4" select="2" />
<field name="def_subject" colspan="4" select="2" />
<field name="use_sign" colspan="4" select="2" />
<field name="file_name" colspan="4" />
<field name="from_account" />
<field name="name"/>
<field name="from_account"/>
<field name="object_name"/>
<field name="def_to"/>
<field name="def_cc"/>
<field name="def_bcc"/>
<field name="def_subject"/>
<field name="use_sign"/>
<field name="file_name"/>
<button name="%(wizard_email_template_preview)d" string="Preview Template"
type="action" target="new" icon="gtk-zoom-fit"/>
</tree>
</field>
</record>
@@ -170,14 +172,21 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Templates">
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="object_name" select="1"/>
<field name="def_to" select="1"/>
<separator orientation="vertical"/>
<field name="lang" select="1"/>
<field name="def_subject" select="1"/>
<field name="file_name" select="1"/>
<group col="13" colspan="4">
<field name="name" select="1"/>
<field name="object_name" select="1"/>
<field name="def_to" select="1"/>
<separator orientation="vertical"/>
<field name="lang" select="1"/>
<field name="def_subject" select="1"/>
<field name="file_name" select="1"/>
</group>
<newline/>
<group expand="0" string="Group by..." colspan="4" col="10">
<filter string="Account" domain="[]" context="{'group_by':'from_account'}" icon="terp-personal"/>
<separator orientation="vertical"/>
<filter string="Resource" domain="[]" context="{'group_by':'object_name'}" icon="terp-accessories-archiver"/>
</group>
</search>
</field>
</record>
-8
View File
@@ -32,14 +32,6 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_hr_form"/>
</record>
<menuitem id="menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10"/>
<menuitem id="menu_hr_dasboard" name="Dashboard" parent="menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
action="open_board_hr"
icon="terp-graph"
id="menu_hr_project"
parent="menu_hr_dasboard"
sequence="4"/>
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15" action="open_board_hr"/>
</data>
</openerp>
@@ -2,6 +2,13 @@
<openerp>
<data>
<menuitem id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
action="hr.open_board_hr"
icon="terp-graph"
id="base.menu_hr_project"
parent="base.menu_hr_dasboard"
sequence="4"/>
<record id="action_my_expense" model="ir.actions.act_window">
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
action="hr.open_board_hr"
icon="terp-graph"
id="base.menu_hr_project"
parent="base.menu_hr_dasboard"
sequence="4"/>
<record id="action_view_holiday_status_board" model="ir.actions.act_window">
<field name="name">My Leaves</field>
<field name="type">ir.actions.act_window</field>
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
action="hr.open_board_hr"
icon="terp-graph"
id="base.menu_hr_project"
parent="base.menu_hr_dasboard"
sequence="4"/>
<record id="action_timesheet_report_all" model="ir.actions.act_window">
<field name="name">Timesheets by Month</field>
<field name="type">ir.actions.act_window</field>
+13 -2
View File
@@ -176,6 +176,14 @@ class mailgate_message(osv.osv):
'''
Mailgateway Message
'''
def truncate_data(self, cr, uid, data, context=None):
data_list = data and data.split('\n') or []
if len(data_list) > 3:
res = '\n\t'.join(data_list[:3]) + '...'
else:
res = '\n\t'.join(data_list)
return res
def _get_display_text(self, cr, uid, ids, name, arg, context=None):
if context is None:
context = {}
@@ -186,11 +194,14 @@ class mailgate_message(osv.osv):
if message.history:
msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) + ':\n\t'
if message.description:
msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...'
msg_txt += self.truncate_data(cr, uid, message.description, context=context)
else:
msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t'
msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t'
if message.name == _('Opportunity'):
msg_txt += _("Converted to Opportunity")
elif message.name == _('Note'):
msg_txt = (message.user_id.name or '/') + _(' added note on ') + format_date_tz(message.date, tz) + ':\n\t'
msg_txt += self.truncate_data(cr, uid, message.description, context=context)
else:
msg_txt += _("Changed Status to: ") + message.name
result[message.id] = msg_txt
+19 -16
View File
@@ -135,12 +135,12 @@ Normal - the campaign runs normally and automatically sends all emails and repor
if activity.type != 'email':
continue
if not activity.email_template_id.from_account:
raise osv.except_osv(_("Error"), _("The campaign cannot be started: an email account is missing in the email activity '%s'")%activity.name)
raise osv.except_osv(_("Error"), _("The campaign cannot be started: the email account is missing in email activity '%s'")%activity.name)
if activity.email_template_id.from_account.state != 'approved':
raise osv.except_osv(_("Error"), _("The campaign cannot be started: the email account is not approved in the email activity '%s'")%activity.name)
raise osv.except_osv(_("Error"), _("The campaign cannot be started: the email account is not approved in email activity '%s'")%activity.name)
if not has_start and not has_signal_without_from:
raise osv.except_osv(_("Error"), _("The campaign hasn't any starting activity nor any activity with a signal and no previous activity."))
raise osv.except_osv(_("Error"), _("The campaign cannot be started: it doesn't have any starting activity (or any activity with a signal and no previous activity)"))
return self.write(cr, uid, ids, {'state': 'running'})
@@ -213,27 +213,31 @@ class marketing_campaign_segment(osv.osv):
_name = "marketing.campaign.segment"
_description = "Campaign Segment"
def _get_next_sync(self, cr, uid, ids, fn, args, context=None):
# next auto sync date is same for all segments
sync_job = self.pool.get('ir.model.data').get_object(cr, uid, 'marketing_campaign', 'ir_cron_marketing_campaign_every_day', context=context)
next_sync = sync_job and sync_job.nextcall or False
return dict.fromkeys(ids, next_sync)
_columns = {
'name': fields.char('Name', size=64,required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
required=True, select=1, ondelete="cascade"),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
'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"),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign', required=True, select=1, ondelete="cascade"),
'object_id': fields.related('campaign_id','object_id', type='many2one', relation='ir.model', string='Resource'),
'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. If no filter is set, all records are selected without filtering. The synchronization mode may also add a criterion to the filter."),
'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)'),
'sync_mode': fields.selection([('create_date', 'Only records created after last sync'),
('write_date', 'Only records modified after last sync (no duplicates)'),
('all', 'All records (no duplicates)')],
'Workitem creation mode',
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."),
'Synchronization mode',
help="Determines an additional criterion to add to the filter when selecting new records to inject in the campaign."),
'state': fields.selection([('draft', 'Draft'),
('running', 'Running'),
('done', 'Done'),
('cancelled', 'Cancelled')],
'State',),
'date_run': fields.datetime('Launching Date', help="Initial start date of this segment."),
'date_run': fields.datetime('Launch Date', help="Initial start date of this segment."),
'date_done': fields.datetime('End Date', help="Date this segment was last closed or cancelled."),
'date_next_sync': fields.function(_get_next_sync, method=True, string='Next Synchronization', type='datetime', help="Next time the synchronization job is scheduled to run automatically"),
}
_defaults = {
@@ -264,7 +268,6 @@ class marketing_campaign_segment(osv.osv):
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
@@ -594,7 +597,7 @@ class marketing_campaign_workitem(osv.osv):
'campaign_id': fields.related('activity_id', 'campaign_id',
type='many2one', relation='marketing.campaign', string='Campaign', readonly=True, store=True),
'object_id': fields.related('activity_id', 'campaign_id', 'object_id',
type='many2one', relation='ir.model', string='Resource', select=1, readonly=True),
type='many2one', relation='ir.model', string='Resource', select=1, readonly=True, store=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),
@@ -5,7 +5,7 @@
<!-- Cron -->
<record model="ir.cron" id="ir_cron_marketing_campaign_every_hour">
<field name="name">Check Marketing Campaign Activities</field>
<field name="name">Marketing Campaign: Campaign workitems processing</field>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
@@ -14,9 +14,9 @@
<field name="function" eval="'process_all'"/>
<field name="args" eval="'()'"/>
</record>
<record model="ir.cron" id="ir_cron_marketing_campaign_every_day">
<field name="name">Check Segment</field>
<field name="name">Marketing Campaign: Segment Sync</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field><!-- it s every day -->
<field name="numbercall">-1</field>
@@ -25,6 +25,6 @@
<field name="function" eval="'process_segment'"/>
<field name="args" eval="'()'"/>
</record>
</data>
</openerp>
@@ -32,14 +32,14 @@
<field name="fixed_cost"/>
</group>
</group>
<field name="activity_ids" nolabel = "1" colspan="4" default_get="{'default_object_id': object_id}" />
<field name="activity_ids" nolabel = "1" colspan="4" context="{'default_object_id': object_id, 'default_campaign_id': active_id}" />
<separator string="" colspan="4" />
<group col="10" colspan="4">
<field name="state" readonly="1" />
<button name="state_running_set" string="Run" states="draft,done,cancelled" icon="gtk-apply"/>
<button name="state_draft_set" string="Set to Draft" states="done,cancelled" icon="gtk-convert"/>
<button name="state_done_set" string="Close" states="running" icon="terp-dialog-close"/>
<button name="state_cancel_set" string="Cancelled" states="running" icon="terp-gtk-stop"/>
<button name="state_cancel_set" string="Cancel" states="running" icon="terp-gtk-stop"/>
</group>
</form>
</field>
@@ -139,18 +139,19 @@
<separator string="Segment" colspan="4"/>
<field name="name"/>
<field name="campaign_id" select="1" on_change="onchange_campaign_id(campaign_id)"/>
<field name="object_id" invisible="1"/>
</group>
<group colspan="2" col="2">
<separator string="Filter" colspan="4"/>
<field name="ir_filter_id" select="1"/>
<field name="ir_filter_id" domain="[('model_id', '=', object_id)]"/>
</group>
<newline/>
<group colspan="2" col="2">
<group colspan="2" col="4">
<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="terp-project" type="object"/>
<field name="sync_mode" required="True" colspan="4"/>
<field name="sync_last_date" colspan="3"/>
<button string="Synchronize Manually" states="running" name="synchroniz" icon="terp-project" type="object"/>
<field name="date_next_sync" colspan="3"/>
</group>
<group colspan="2" col="2">
<separator string="History" colspan="2"/>
@@ -179,6 +180,7 @@
<field name="campaign_id"/>
<field name="date_run"/>
<field name="sync_last_date"/>
<button string="Synchronize Manually" states="running" name="synchroniz" icon="terp-project" type="object"/>
<field name="state" />
</tree>
</field>
@@ -193,9 +195,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-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')]"/>
<filter icon="terp-project" string="Newly Created" help="Sync mode: only records created after last sync" domain="[('sync_mode','=','create_date')]"/>
<filter icon="terp-project" string="Newly Modified" help="Sync mode: only records updated after last sync" domain="[('sync_mode','=','write_date')]"/>
<filter icon="terp-project" string="All" help="Sync mode: all records" domain="[('sync_mode','=','all')]"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="campaign_id" select="1"/>
@@ -207,7 +209,7 @@
<separator orientation="vertical"/>
<filter string="State" name="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}" />
<separator orientation="vertical"/>
<filter string="Run Date" name="Date Run" icon="terp-go-month" context="{'group_by':'date_run'}" />
<filter string="Launch Date" name="Launch Date" icon="terp-go-month" context="{'group_by':'date_run'}" />
</group>
</search>
</field>
@@ -246,6 +248,7 @@
<field name="signal" groups="base.group_extended"/>
<field name="start"/>
<field name="object_id" invisible="1"/>
<field name="campaign_id" invisible="1"/>
</group>
<group colspan='2' col='2'>
<separator string="Cost / Revenue" colspan="4"/>
@@ -271,37 +274,35 @@
<field name="server_action_id" attrs="{'required':[('type','=','action')],'invisible':[('type','!=','action')]}" domain="[('model_id','=',object_id)]" />
</group>
</group>
<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">
<field name="activity_from_id"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
<form string="Incoming Transitions">
<field name="activity_from_id"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
</field>
<field name="to_ids" nolabel="1" mode="tree,form" default_get="{'default_activity_from_id': active_id}">
<tree string="Outgoing Transitions" editable="bottom">
<field name="activity_to_id"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
<form string="Outgoing Transitions">
<field name="activity_to_id"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
</field>
</group>
<separator string="Transitions" colspan="4"/>
<field name="from_ids" nolabel="1" mode="tree,form" context="{'default_activity_to_id': active_id}" colspan="2">
<tree string="Incoming Transitions" editable="bottom">
<field name="activity_from_id" domain="[('campaign_id', '=', parent.campaign_id)]"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
<form string="Incoming Transitions">
<field name="activity_from_id" domain="[('campaign_id', '=', parent.campaign_id)]"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
</field>
<field name="to_ids" nolabel="1" mode="tree,form" context="{'default_activity_from_id': active_id}" colspan="2">
<tree string="Outgoing Transitions" editable="bottom">
<field name="activity_to_id" domain="[('campaign_id', '=', parent.campaign_id)]"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
<form string="Outgoing Transitions">
<field name="activity_to_id" domain="[('campaign_id', '=', parent.campaign_id)]"/>
<field name='trigger'/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
</field>
</form>
</field>
</record>
@@ -333,14 +334,15 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:state in ('exception');black:state in ('todo');gray:state in ('cancelled')" string="Marketing Campaign Activities">
<field name="campaign_id"/>
<field name="segment_id"/>
<field name="activity_id" />
<field name="object_id" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="res_name" />
<field name="partner_id"/>
<field name="date"/>
<field name="state"/>
<field name="res_id" invisible="1"/>
<field name="campaign_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"/>
@@ -394,21 +396,28 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Marketing Campaign Activities">
<filter icon="terp-go-today" string="Today" name="today" domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('date','&gt;=', 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="res_name" select="1"/>
<field name="res_id" select="1"/>
<field name="partner_id" select="1"/>
<field name="date" select="1"/>
<group colspan="4" col="10">
<filter icon="terp-go-today" string="Today" name="today" domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('date','&gt;=', 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="campaign_id"/>
<field name="segment_id"/>
<field name="date"/>
<newline/>
<field name="object_id"/>
<field name="res_name"/>
<field name="res_id"/>
<field name="partner_id"/>
</group>
<newline/>
<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="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="Resource" name="resource" icon="terp-accessories-archiver" context="{'group_by':'object_id'}" />
<filter string="Resource ID" name="res_id" 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"/>
@@ -426,7 +435,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_marketing_campaign_workitem_tree"/>
<field name="search_view_id" ref="view_marketing_campaign_workitem_search"/>
<field name="context">{'group_by': [], 'search_default_todo': 1}</field>
<field name="context">{'group_by': [], 'search_default_todo': 1, 'search_default_today': 1}</field>
</record>
<menuitem id="menu_action_marketing_campaign_workitem" parent="menu_marketing_campaign" action="action_marketing_campaign_workitem" sequence="30"/>
@@ -443,7 +452,7 @@
<!-- Campaign Followups -->
<act_window domain="[('campaign_id', '=', active_id)]"
id="act_marketing_campaing_followup"
name="Campaign Follow-ups" res_model="marketing.campaign.workitem"
name="Campaign Follow-up" res_model="marketing.campaign.workitem"
src_model="marketing.campaign" view_mode="tree,form"
view_type="form" />
@@ -44,11 +44,12 @@ class campaign_analysis(osv.osv):
_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'),
('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')],
'Month', readonly=True),
'month': fields.selection([('01','January'), ('02','February'),
('03','March'), ('04','April'),('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')],
'Month', readonly=True),
'day': fields.char('Day', size=10, readonly=True),
'date': fields.date('Date', readonly=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
readonly=True),
@@ -63,6 +64,9 @@ class campaign_analysis(osv.osv):
type="float" ),
'revenue': fields.float('Revenue',digits=(16,2),readonly=True),
'count' : fields.integer('# of Actions', readonly=True),
'state': fields.selection([('todo', 'To Do'),
('exception', 'Exception'), ('done', 'Done'),
('cancelled', 'Cancelled')], 'State', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'campaign_analysis')
@@ -73,6 +77,7 @@ class campaign_analysis(osv.osv):
min(wi.res_id) as res_id,
to_char(wi.date::date, 'YYYY') as year,
to_char(wi.date::date, 'MM') as month,
to_char(wi.date::date, 'YYYY-MM-DD') as day,
wi.date::date as date,
s.campaign_id as campaign_id,
wi.activity_id as activity_id,
@@ -9,6 +9,7 @@
<tree string="Marketing Reports">
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="day" invisible="1"/>
<field name="date" invisible="1"/>
<field name="campaign_id" invisible="1"/>
<field name="activity_id" invisible="1"/>
@@ -28,7 +29,7 @@
<field name="model">campaign.analysis</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Marketing Reports">
<search string="Campaign Analysis">
<group>
<filter icon="terp-go-year"
string="This Year"
@@ -66,7 +67,7 @@
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-today" context="{'group_by':'date'}"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
@@ -75,7 +76,7 @@
</record>
<record id="action_campaign_analysis_all" model="ir.actions.act_window">
<field name="name">Campaigns</field>
<field name="name">Campaign Analysis</field>
<field name="res_model">campaign.analysis</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
+10 -10
View File
@@ -120,34 +120,34 @@ class project_tasks(osv.osv):
message_id=message_id, attach=attach, \
context=context)
def do_draft(self, cr, uid, ids, *args):
res = super(project_tasks, self).do_draft(cr, uid, ids, *args)
def do_draft(self, cr, uid, ids, *args, **kwargs):
res = super(project_tasks, self).do_draft(cr, uid, ids, *args, **kwargs)
tasks = self.browse(cr, uid, ids)
self._history(cr, uid, tasks, _('Draft'))
return res
def do_open(self, cr, uid, ids, *args):
res = super(project_tasks, self).do_open(cr, uid, ids, *args)
def do_open(self, cr, uid, ids, *args, **kwargs):
res = super(project_tasks, self).do_open(cr, uid, ids, *args, **kwargs)
tasks = self.browse(cr, uid, ids)
self._history(cr, uid, tasks, _('Open'))
return res
def do_pending(self, cr, uid, ids, *args):
res = super(project_tasks, self).do_pending(cr, uid, ids, *args)
def do_pending(self, cr, uid, ids, *args, **kwargs):
res = super(project_tasks, self).do_pending(cr, uid, ids, *args, **kwargs)
tasks = self.browse(cr, uid, ids)
self._history(cr, uid, tasks, _('Pending'))
return res
def do_close(self, cr, uid, ids, *args):
res = super(project_tasks, self).do_close(cr, uid, ids, *args)
def do_close(self, cr, uid, ids, *args, **kwargs):
res = super(project_tasks, self).do_close(cr, uid, ids, *args, **kwargs)
tasks = self.browse(cr, uid, ids)
for task in tasks:
if task.state == 'done':
self._history(cr, uid, tasks, _('Done'))
return res
def do_cancel(self, cr, uid, ids, *args):
res = super(project_tasks, self).do_cancel(cr, uid, ids, *args)
def do_cancel(self, cr, uid, ids, *args, **kwargs):
res = super(project_tasks, self).do_cancel(cr, uid, ids, *args, **kwargs)
tasks = self.browse(cr, uid, ids)
self._history(cr, uid, tasks, _('Cancel'))
return res
+9 -11
View File
@@ -29,22 +29,20 @@ class project_task(osv.osv):
'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null')
}
def do_close(self, cr, uid, ids, *args):
res = super(project_task, self).do_close(cr, uid, ids, *args)
tasks = self.browse(cr, uid, ids)
for task in tasks:
def _validate_subflows(self, cr, uid, ids):
for task in self.browse(cr, uid, ids):
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.done', cr)
def do_close(self, cr, uid, ids, *args, **kwargs):
res = super(project_task, self).do_close(cr, uid, ids, *args, **kwargs)
self._validate_subflows(cr, uid, ids)
return res
def do_cancel(self, cr, uid, ids, *args):
res = super(project_task, self).do_cancel(cr, uid, ids, *args)
tasks = self.browse(cr, uid, ids)
for task in tasks:
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.cancel', cr)
def do_cancel(self, cr, uid, ids, *args, **kwargs):
res = super(project_task, self).do_cancel(cr, uid, ids, *args, **kwargs)
self._validate_subflows(cr, uid, ids)
return True
project_task()
+13 -12
View File
@@ -69,19 +69,20 @@
],
'demo_xml': ['sale_demo.xml'],
'test': [
'test/data_test.yml',
'test/manual_order_policy.yml',
'test/prepaid_order_policy.yml',
'test/picking_order_policy.yml',
'test/postpaid_order_policy.yml',
'test/advance_invoice.yml',
'test/so_make_line_invoice.yml',
'test/sale_procurement.yml',
'test/invoice_on_ordered_qty.yml',
'test/invoice_on_shipped_qty.yml',
],
'test/data_test.yml',
'test/manual_order_policy.yml',
'test/prepaid_order_policy.yml',
'test/picking_order_policy.yml',
'test/postpaid_order_policy.yml',
'test/advance_invoice.yml',
'test/so_make_line_invoice.yml',
'test/sale_procurement.yml',
'test/invoice_on_ordered_qty.yml',
'test/invoice_on_shipped_qty.yml',
'test/sale_order_print.yml',
],
'installable': True,
'active': False,
'certificate': '0058103601429',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -5
View File
@@ -80,10 +80,9 @@
<field name="arch" type="xml">
<tree string="Sales orders">
<field name="name"/>
<field name="date_order"/>
<field name="partner_id"/>
<field name="user_id" />
<field name="date_order"/>
<field name="partner_shipping_id"/>
<field name="picked_rate" widget="progressbar"/>
<field name="invoiced_rate" widget="progressbar"/>
<field name="amount_untaxed" sum="Total Untaxed amount"/>
@@ -262,12 +261,11 @@
<filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sale Orders ready to be invoiced"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="date_order" select="1" string="Order date" />
<field name="partner_id" select="1"/>
<field name="user_id" select="1">
<filter domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal"/>
<filter domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal"/>
</field>
<field name="date_order" select="1" string="Order date" />
<newline/>
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
<filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
+8
View File
@@ -0,0 +1,8 @@
-
In order to test the PDF reports defined on a sale order, we will print a sale order
-
!python {model: sale.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.order'),ref('sale.order2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'sale-sale_order.'+format), 'wb+').write(data)
+13 -14
View File
@@ -245,7 +245,7 @@
<newline/>
<field name="author_id" readonly="1"/>
<newline/>
<separator string="Description" colspan="4"/>
<separator string="Description" colspan="4"/>
<field colspan="4" name="description" nolabel="1"/>
</form>
</field>
@@ -549,7 +549,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Entry Lines">
<group height="200" width="500">
<group height="200" width="500">
<field name="address_id" invisible="True" context="{'contact_display':'partner'}"/>
<field name="picking_id" invisible="True"/>
<field domain="[('picking_id','&lt;&gt;',picking_id),('state','in',['confirmed','assigned']),('picking_id.address_id','=',address_id)]" name="move_ids" nolabel="1" height="100" width="500"/><newline/>
@@ -562,14 +562,14 @@
</field>
</record>
<act_window name="Unreceived Products"
res_model="stock.picking.move.wizard"
src_model="stock.picking"
view_mode="form"
target="new"
<act_window name="Unreceived Products"
res_model="stock.picking.move.wizard"
src_model="stock.picking"
view_mode="form"
target="new"
key2="client_action_multi"
id="act_stock_picking_move_wizard"/>
id="act_stock_picking_move_wizard"/>
<record model="ir.ui.view" id="stock_picking_calendar">
<field name="name">stock.picking.calendar</field>
<field name="model">stock.picking</field>
@@ -597,8 +597,7 @@
<field name="invoice_state"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
<field name="state"/>
<button name="%(action_partial_picking)d" states="assigned" string="Approve" type="action" icon="gtk-go-forward" help="Approve Picking"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the picking. Do you want to continue?"/>
<button name="%(action_partial_picking)d" states="confirmed,assigned" string="Approve" type="action" icon="gtk-go-forward" help="Approve Picking"/>
</tree>
</field>
</record>
@@ -1124,7 +1123,7 @@
<button name="action_assign" states="confirmed" string="Check Availability" type="object" groups="base.group_extended" icon="gtk-apply"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
<button name="%(action_partial_picking)d" states="assigned" string="Done" type="action" icon="gtk-execute"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" type="action" icon="terp-document-new" attrs="{'invisible':[('invoice_state','!=','2binvoiced')]}"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" type="action" icon="terp-document-new" attrs="{'invisible':[('invoice_state','!=','2binvoiced')]}"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
@@ -1335,7 +1334,7 @@
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" groups="base.group_extended" icon="gtk-jump-to"/>
<button name="%(action_partial_picking)d" states="assigned" string="Products Received" type="action" icon="gtk-ok"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" type="action" icon="terp-document-new" attrs="{'invisible':[('invoice_state','!=','2binvoiced')]}"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" type="action" icon="terp-document-new" attrs="{'invisible':[('invoice_state','!=','2binvoiced')]}"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
@@ -1790,7 +1789,7 @@
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|','&amp;',('picking_id','=',False),('location_id.usage', 'in', ['customer','supplier']),'&amp;',('picking_id','!=',False),('picking_id.type','=','in')]</field>
<field name="domain">['|','&amp;',('picking_id','=',False),('location_id.usage', 'in', ['customer','supplier']),'&amp;',('picking_id','!=',False),('picking_id.type','=','in')]</field>
<field name="view_id" ref="view_move_tree_reception_picking"/>
<field name="context">{"search_default_receive":1}</field>
<field name="search_view_id" ref="view_move_search_reception_picking"/>