[MERGE] fixing usability

bzr revid: hmo@tinyerp.com-20110426073918-j333hzotq62a69nz
This commit is contained in:
Harry (OpenERP) 2011-04-26 13:09:18 +05:30
commit d96ceb7e74
45 changed files with 130 additions and 82 deletions

View File

@ -2146,8 +2146,8 @@ class account_model_line(osv.osv):
_description = "Account Model Entries"
_columns = {
'name': fields.char('Name', size=64, required=True),
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the resources from lower sequences to higher ones"),
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Account'), help="The optional quantity on entries"),
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the resources from lower sequences to higher ones."),
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Account'), help="The optional quantity on entries."),
'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade"),
@ -2156,7 +2156,7 @@ class account_model_line(osv.osv):
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency."),
'currency_id': fields.many2one('res.currency', 'Currency'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Maturity date', help="The maturity date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Maturity Date', help="The maturity date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
}
_order = 'sequence'
_sql_constraints = [

View File

@ -454,7 +454,7 @@
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Sequence" colspan="4"/>
<field name="sequence_id" required="0"/>
<field name="sequence_id"/>
</group>
</page>
<page string="Entry Controls" groups="base.group_extended">

View File

@ -31,7 +31,7 @@ class account_aged_trial_balance(osv.osv_memory):
_description = 'Account Aged Trial balance Report'
_columns = {
'period_length':fields.integer('Period length (days)', required=True),
'period_length':fields.integer('Period Length (days)', required=True),
'direction_selection': fields.selection([('past','Past'),
('future','Future')],
'Analysis Direction', required=True),

View File

@ -30,11 +30,11 @@ class account_common_report(osv.osv_memory):
_description = "Account Common Report"
_columns = {
'chart_account_id': fields.many2one('account.account', 'Chart of account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
'chart_account_id': fields.many2one('account.account', 'Chart of Account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', help='Keep empty for all open fiscal year'),
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
'period_from': fields.many2one('account.period', 'Start period'),
'period_to': fields.many2one('account.period', 'End period'),
'period_from': fields.many2one('account.period', 'Start Period'),
'period_to': fields.many2one('account.period', 'End Period'),
'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'date_from': fields.date("Start Date"),
'date_to': fields.date("End Date"),

View File

@ -28,7 +28,7 @@ class account_common_account_report(osv.osv_memory):
_columns = {
'display_account': fields.selection([('bal_all','All'), ('bal_movement','With movements'),
('bal_solde','With balance is not equal to 0'),
],'Display accounts', required=True),
],'Display Accounts', required=True),
}
_defaults = {

View File

@ -28,10 +28,10 @@ class account_report_general_ledger(osv.osv_memory):
_columns = {
'landscape': fields.boolean("Landscape Mode"),
'initial_balance': fields.boolean("Include initial balances",
'initial_balance': fields.boolean("Include Initial Balances",
help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort By', required=True),
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort by', required=True),
}
_defaults = {
'landscape': True,

View File

@ -30,10 +30,10 @@ class account_partner_ledger(osv.osv_memory):
_description = 'Account Partner Ledger'
_columns = {
'initial_balance': fields.boolean('Include initial balances',
'initial_balance': fields.boolean('Include Initial Balances',
help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'reconcil': fields.boolean('Include Reconciled Entries', help='Consider reconciled entries'),
'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'),
'page_split': fields.boolean('One Partner per Page', help='Display Ledger Report with One partner per page'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
}

View File

@ -29,7 +29,7 @@ class account_print_journal(osv.osv_memory):
_columns = {
'sort_selection': fields.selection([('date', 'Date'),
('ref', 'Reference Number'),],
'Entries Sorted By', required=True),
'Entries Sorted by', required=True),
}
_defaults = {
'sort_selection': 'date',

View File

@ -28,7 +28,7 @@ class account_vat_declaration(osv.osv_memory):
_columns = {
'based_on': fields.selection([('invoices', 'Invoices'),
('payments', 'Payments'),],
'Based On', required=True),
'Based on', required=True),
'chart_tax_id': fields.many2one('account.tax.code', 'Chart of Tax', help='Select Charts of Taxes', required=True, domain = [('parent_id','=', False)]),
}

View File

@ -67,6 +67,8 @@ class budget_report(report_sxw.rml_parse):
context = {'wizard_date_from': d_from, 'wizard_date_to': d_to}
for i in range(0, len(an_ids)):
if not an_ids[i][0]:
continue
analytic_name = acc_analytic_obj.browse(self.cr, self.uid, [an_ids[i][0]])
res={
'b_id': '-1',

View File

@ -72,6 +72,8 @@ class budget_report(report_sxw.rml_parse):
context = {'wizard_date_from': d_from, 'wizard_date_to': d_to}
for i in range(0, len(an_ids)):
if not an_ids[i][0]:
continue
analytic_name = acc_analytic_obj.browse(self.cr, self.uid, [an_ids[i][0]])
res={
'b_id': '-1',

View File

@ -338,7 +338,7 @@ class payment_line(osv.osv):
required=True, help='Payment amount in the partner currency'),
'currency': fields.many2one('res.currency','Partner Currency', required=True),
'company_currency': fields.many2one('res.currency', 'Company Currency', readonly=True),
'bank_id': fields.many2one('res.partner.bank', 'Destination Bank account'),
'bank_id': fields.many2one('res.partner.bank', 'Destination Bank Account'),
'order_id': fields.many2one('payment.order', 'Order', required=True,
ondelete='cascade', select=True),
'partner_id': fields.many2one('res.partner', string="Partner", required=True, help='The Ordering Customer'),

View File

@ -379,6 +379,8 @@ class account_voucher(osv.osv):
account_id = partner.property_account_payable.id
tr_type = 'purchase'
else:
if not journal.default_credit_account_id or not journal.default_debit_account_id:
raise osv.except_osv(_('Error !'), _('Please define default credit/debit account on the %s !') % (journal.name))
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
tr_type = 'receipt'

View File

@ -1296,7 +1296,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
if name == "UNTIL":
is_until = True
value = parser.parse(value)
rrule_until_date = parser.parse(value.strftime("%Y-%m-%d"))
rrule_until_date = parser.parse(value.strftime("%Y-%m-%d %H:%M:%S"))
if until_date and until_date >= rrule_until_date:
until_date = rrule_until_date
if until_date:

View File

@ -140,7 +140,7 @@ send an Email to Invited Person')
if not mail_to:
name = map(lambda x: x[1], filter(lambda x: type==x[0], \
self._columns['type'].selection))
raise osv.except_osv(_('Error!'), ("%s must have an email Address to send mail") %(name[0]))
raise osv.except_osv(_('Error!'), _("%s must have an email address to send mail") %(name[0]))
att_obj._send_mail(cr, uid, attendees, mail_to, \
email_from = current_user.user_email or tools.config.get('email_from', False))

View File

@ -48,7 +48,7 @@ class report_graph(report.interface.report_int):
if id:
get_dpend_module(id[0].id)
get_dpend_module(module_id)
graph = pydot.Dot(graph_type='digraph',fontsize='10', label="\\nProximity Graph. \\n\\nGray Color:Official Modules, Red Color:Extra Addons Modules, Blue Color:Community Modules, Purple Color:Unknow Modules"
graph = pydot.Dot(graph_type='digraph',fontsize='10', label="\\nProximity Graph. \\n\\nGray Color-Official Modules, Red Color-Extra Addons Modules, Blue Color-Community Modules, Purple Color-Unknow Modules"
, center='1')
for node in nodes:
if node[1] == "official":

View File

@ -15,8 +15,10 @@
<separator string="Description" colspan="4"/>
<field name="description" colspan="4" nolabel="1"/>
<separator colspan="4"/>
<group col="4" colspan="4">
<label string="" colspan="2"/>
<button special="cancel" string="_Close" icon="gtk-close"/>
</group>
</group>
</form>
</field>

View File

@ -329,6 +329,13 @@ class crm_lead(crm_case, osv.osv):
self.write(cr, uid, ids, data)
return stage
def unlink(self, cr, uid, ids, context=None):
for lead in self.browse(cr, uid, ids, context):
if (not lead.section_id.allow_unlink) and (lead.state <> 'draft'):
raise osv.except_osv(_('Warning !'),
_('You can not delete this lead. You should better cancel it.'))
return super(crm_lead, self).unlink(cr, uid, ids, context)
def message_new(self, cr, uid, msg, context=None):
"""
Automatically calls when new email message arrives

View File

@ -44,7 +44,7 @@
<field name="alarm_id" string="Reminder"
widget="selection" />
<group colspan="2" col="4" attrs="{'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}">
<field name="recurrency"/>
<field name="recurrency" help="Is Meeting is occurring frequently or repeatedly?"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
on_change="onchange_edit_all(rrule_type,edit_all)"/>
</group>
@ -102,7 +102,7 @@
<tree string="Invitation details" editable="top">
<field name="sent_by_uid" string="From"/>
<field name="user_id" string="To"/>
<field name="email" string="Mail TO"/>
<field name="email" string="Mail To"/>
<field name="role" select="1" />
<field name="state" />
<button name="do_tentative"
@ -179,7 +179,7 @@
<field name="count" attrs="{'invisible' : [('end_type', '!=', 'count')] }"/>
<label string=" " colspan="2" />
<newline />
<field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')] }"/>
<field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}"/>
<newline />

View File

@ -3,7 +3,7 @@
<data>
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="0"
groups="base.group_sale_manager,base.group_sale_salesman,base.group_partner_manager"/>
groups="base.group_sale_manager,base.group_sale_salesman"/>
<menuitem id="base.menu_crm_config_lead" name="Leads &amp; Opportunities"
parent="base.menu_base_config" sequence="1" groups="base.group_sale_manager"/>

View File

@ -105,7 +105,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context):
if lead.state in ['done', 'cancel']:
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled Leads Could not convert into Opportunity"))
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled Leads can not be converted into Opportunity"))
return False
def _convert(self, cr, uid, ids, lead, partner_id, stage_ids, context=None):

View File

@ -16,7 +16,7 @@
<newline/>
<field name="user_id" />
<field name="section_id" widget="selection" />
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<field name="categ_id" string="Type" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<separator string="" colspan="4"/>
<group colspan="4">
<label string ="" colspan="2"/>

View File

@ -8,7 +8,7 @@
<field name="model">crm.partner2opportunity</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Convert To Opportunity">
<form string="Create Opportunity">
<field name="name"/>
<field name="partner_id"/>
<newline/>

View File

@ -55,7 +55,7 @@ class crm_phonecall2opportunity(osv.osv_memory):
case = phonecall_obj.browse(cr, uid, record_id, context=context)
if case.state in ['done', 'cancel']:
raise osv.except_osv(_("Warning"), _("Closed/Cancelled Phone \
Call Could not convert into Opportunity"))
Call can not be converted into Opportunity"))
def action_apply(self, cr, uid, ids, context=None):

View File

@ -15,7 +15,7 @@
<field name="date" string="Planned Date"/>
<field name="user_id" />
<field name="section_id"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<field name="categ_id" string="Type" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
<separator string=" " colspan="4"/>
<group colspan="4" col="3" >
<label string=" " />

View File

@ -13,7 +13,7 @@
</record>
<menuitem
name="Synchronyze this calendar"
name="Synchronize This Calendar"
action="action_caldav_browse"
id="menu_caldav_browse"
icon="STOCK_EXECUTE"

View File

@ -177,9 +177,10 @@
<group colspan="4">
<field colspan="4" name="email_cc" string="Global CC" widget="char"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
<field name="message_ids" colspan="4" nolabel="1" mode="tree,form" readonly="1">
<tree string="History">
<field name="display_text" string="History Information"/>
<field name="history" invisible="1"/>
<button
string="Reply"
name="%(crm.action_crm_send_mail)d"

View File

@ -205,12 +205,12 @@ class event_event(osv.osv):
'child_ids': fields.one2many('event.event', 'parent_id', 'Child Events', readonly=False, states={'done': [('readonly', True)]}),
'reply_to': fields.char('Reply-To', size=64, readonly=False, states={'done': [('readonly', True)]}, help="The email address put in the 'Reply-To' of all emails sent by OpenERP"),
'type': fields.many2one('event.type', 'Type', help="Type of Event like Seminar, Exhibition, Conference, Training.", readonly=False, states={'done': [('readonly', True)]}),
'register_max': fields.integer('Maximum Registrations', help="Provide Maximun Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}),
'register_min': fields.integer('Minimum Registrations', help="Providee Minimum Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}),
'register_max': fields.integer('Maximum Registrations', help="Provide Maximum Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}),
'register_min': fields.integer('Minimum Registrations', help="Provide Minimum Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}),
'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current',
help="Total of Open and Done Registrations"),
'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect',
help="Total of Prospect Registrati./event/event.py:41:ons"),
help="Total of Prospect Registrations"),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'date_begin': fields.datetime('Beginning date', required=True, help="Beginning Date of Event", readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True, states={'draft': [('readonly', False)]}),
@ -221,15 +221,15 @@ class event_event(osv.osv):
('cancel', 'Cancelled')],
'State', readonly=True, required=True,
help='If event is created, the state is \'Draft\'.If event is confirmed for the particular dates the state is set to \'Confirmed\'. If the event is over, the state is set to \'Done\'.If event is cancelled the state is set to \'Cancelled\'.'),
'mail_auto_registr': fields.boolean('Mail Auto Register', readonly=False, states={'done': [('readonly', True)]}, help='Check this box if you want to use the automatic mailing for new registration'),
'mail_auto_confirm': fields.boolean('Mail Auto Confirm', readonly=False, states={'done': [('readonly', True)]}, help='Check this box if you want ot use the automatic confirmation emailing or the reminder'),
'mail_auto_registr': fields.boolean('Mail Auto Register', readonly=False, states={'done': [('readonly', True)]}, help='Check this box if you want to use automatic emailing for new registration.'),
'mail_auto_confirm': fields.boolean('Mail Auto Confirm', readonly=False, states={'done': [('readonly', True)]}, help='Check this box if you want to use automatic confirmation emailing or reminder.'),
'mail_registr': fields.text('Registration Email', readonly=False, states={'done': [('readonly', True)]}, help='This email will be sent when someone subscribes to the event.'),
'mail_confirm': fields.text('Confirmation Email', readonly=False, states={'done': [('readonly', True)]}, help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."),
'mail_confirm': fields.text('Confirmation Email', readonly=False, states={'done': [('readonly', True)]}, help="This email will be sent when the event gets confirmed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."),
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="The invoices of this event registration will be created with this Product. Thus it allows you to set the default label and the accounting info you want by default on these invoices."),
'note': fields.text('Notes', help="Description or Summary of Event", readonly=False, states={'done': [('readonly', True)]}),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current event."),
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to", digits_compute=dp.get_precision('Sale Price')),
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who are giving speech on event."),
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify a specific amount for each registration.", digits_compute=dp.get_precision('Sale Price')),
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who will be giving speech at the event."),
'speaker_ids': fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}),
'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}),
'speaker_confirmed': fields.boolean('Speaker Confirmed', readonly=False, states={'done': [('readonly', True)]}),

View File

@ -29,7 +29,7 @@ class hr_action_reason(osv.osv):
_description = "Action Reason"
_columns = {
'name': fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
'action_type': fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),
'action_type': fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action Type"),
}
_defaults = {
'action_type': 'sign_in',
@ -137,7 +137,7 @@ class hr_employee(osv.osv):
res = {'action': type, 'employee_id': emp['id']}
if dt:
res['name'] = dt
res['name'] = dt
id = obj_attendance.create(cr, uid, res, context=context)
if type != 'action':

View File

@ -183,6 +183,7 @@
<separator colspan="2" string="Advantages"/>
<field name="advantages_net"/>
<field name="advantages_gross"/>
<separator colspan="2" string="Advantages Notes"/>
<field name="advantages" nolabel="1" colspan="2"/>
</group>
<separator colspan="4" string="Notes"/>

View File

@ -252,7 +252,7 @@
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
<filter icon="terp-check" string="Current" domain="[('state','=','wait'))]" help="Evaluations that are in waiting state"/>
<filter icon="terp-check" string="Current" domain="[('state','=','wait')]" help="Evaluations that are in waiting state"/>
<filter icon="terp-camera_test" string="In progress" domain="[('state','=','progress')]" help="Evaluations that are in progress state"/>
<separator orientation="vertical"/>
<filter icon="terp-go-week" string="7 Days" help="Evaluations to close within the next 7 days"

View File

@ -113,16 +113,18 @@ class hr_holidays(osv.osv):
'name': fields.char('Description', required=True, size=64),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'),
'State', readonly=True, help='The state is set to \'Draft\', when a holiday request is created.\
\nThe state is \'Waiting Approval\', when holiday request is confirmed by user.\
\nThe state is \'Refused\', when holiday request is refused by manager.\
\nThe state is \'Approved\', when holiday request is approved by manager.'),
'user_id':fields.related('employee_id', 'user_id', type='many2one', relation='res.users', string='User', store=True),
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
'holiday_status_id': fields.many2one("hr.holidays.status", "Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
#'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
#'manager_id': fields.many2one('hr.employee', 'Leave Manager', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'),
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'),
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
@ -133,7 +135,7 @@ class hr_holidays(osv.osv):
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
'category_id': fields.many2one('hr.employee.category', "Category", help='Category of Employee'),
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automatically filled by the user who validate the leave with second level (If Leave type need second validation)')
}
_defaults = {
'employee_id': _employee_get,
@ -144,8 +146,8 @@ class hr_holidays(osv.osv):
}
_sql_constraints = [
('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "You have to select an employee or a category"),
('date_check', "CHECK ( number_of_days_temp > 0 )", "The number of days must be greater than 0 !"),
('date_check2', "CHECK ( (type='add') OR (date_from < date_to))", "The start date must be before the end date !")
('date_check2', "CHECK ( (type='add') OR (date_from <= date_to))", "The start date must be before the end date !"),
('date_check', "CHECK ( number_of_days_temp >= 0 )", "The number of days must be greater than 0 !"),
]
def _create_resource_leave(self, cr, uid, vals, context=None):
@ -217,6 +219,7 @@ class hr_holidays(osv.osv):
})
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_delete(uid, 'hr.holidays', id, cr)
wf_service.trg_create(uid, 'hr.holidays', id, cr)
return True

View File

@ -93,7 +93,7 @@
<newline/>
<field name="state" colspan="2"/>
<group colspan="2" col="6">
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_user,base.group_hr_manager"/>
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>

View File

@ -97,15 +97,15 @@
<page string="Job Info">
<group col="3" colspan="2">
<separator colspan="3" string="Contact"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" attrs="{'readonly':[('state','not in','done')]}"/>
<button string="Create Partner"
name="%(action_hr_recruitment_partner_create)d"
icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/>
icon="gtk-index" type="action" attrs="{'readonly':['!',('partner_id','!=',False),('state','not in','done')]}" groups="base.group_partner_manager"/>
<newline/>
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/>
<field name="email_from" colspan="3"/>
<field name="partner_phone" colspan="3"/>
<field name="partner_mobile" colspan="3"/>
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3" attrs="{'readonly':[('state','not in','done')]}"/>
<field name="email_from" colspan="3" attrs="{'readonly':[('state','not in','done')]}"/>
<field name="partner_phone" colspan="3" attrs="{'readonly':[('state','not in','done')]}"/>
<field name="partner_mobile" colspan="3" attrs="{'readonly':[('state','not in','done')]}"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Contract Data"/>
@ -130,10 +130,10 @@
<separator colspan="4" string="Status"/>
<group col="8" colspan="4">
<field name="state"/>
<button name="case_cancel" string="Refused" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_cancel" string="Refuse" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_pending" string="Pending" states="open" type="object" icon="gtk-media-pause"/>
<button name="%(action_hr_recruitment_hired_employee)d" string="Hired" states="open,pending" type="action" icon="terp-partner"/>
<button name="%(action_hr_recruitment_hired_employee)d" string="Hire" states="open,pending" type="action" icon="terp-partner"/>
<button name="case_reset" string="Reset to New" states="done,cancel" type="object" icon="gtk-convert"/>
</group>
</page>

View File

@ -31,11 +31,28 @@ DefaultVoteValue = '50'
class idea_category(osv.osv):
""" Category of Idea """
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
res = []
for record in reads:
name = record['name']
if record['parent_id']:
name = record['parent_id'][1]+' / '+name
res.append((record['id'], name))
return res
def _categ_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
res = self.name_get(cr, uid, ids, context=context)
return dict(res)
_name = "idea.category"
_description = "Idea Category"
_columns = {
'name': fields.char('Category', size=64, required=True),
'complete_name': fields.function(_categ_name_get_fnc, method=True, type="char", string='Name'),
'summary': fields.text('Summary'),
'parent_id': fields.many2one('idea.category', 'Parent Categories', ondelete='set null'),
'child_ids': fields.one2many('idea.category', 'parent_id', 'Child Categories'),
@ -46,6 +63,10 @@ class idea_category(osv.osv):
]
_order = 'parent_id,name asc'
_constraints = [
(osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
]
idea_category()
class idea_idea(osv.osv):

View File

@ -46,7 +46,7 @@
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree string="Category of ideas">
<field name="name"/>
<field name="complete_name"/>
<field name="parent_id" invisible="1"/>
</tree>
</field>
@ -234,11 +234,11 @@
<field name="count_votes" />
</group>
<field name="stat_vote_ids" colspan="4" mode="graph,tree" nolabel="1">
<graph string="Vots Statistics" type="bar">
<graph string="Votes Statistics" type="bar">
<field name="score"/>
<field name="nbr"/>
</graph>
<tree string="Vots Statistics">
<tree string="Votes Statistics">
<field name="score"/>
<field name="nbr"/>
</tree>

View File

@ -267,7 +267,7 @@ class pos_order(osv.osv):
'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True),
'price_type': fields.selection([
('tax_excluded','Tax excluded')],
'Price method', required=True),
'Price Method', required=True),
'statement_ids': fields.one2many('account.bank.statement.line', 'pos_statement_id', 'Payments', states={'draft': [('readonly', False)]}, readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, states={'draft': [('readonly', False)]}, readonly=True),
'partner_id': fields.many2one('res.partner', 'Customer', change_default=True, select=1, states={'draft': [('readonly', False)], 'paid': [('readonly', False)]}),
@ -426,12 +426,15 @@ class pos_order(osv.osv):
move_obj = self.pool.get('stock.move')
pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
orders = self.browse(cr, uid, ids, context=context)
partner_obj = self.pool.get('res.partner')
for order in orders:
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
if not order.picking_id:
new = True
picking_id = picking_obj.create(cr, uid, {
'name': pick_name,
'origin': order.name,
'address_id': addr.get('delivery',False),
'type': 'out',
'state': 'draft',
'move_type': 'direct',

View File

@ -72,8 +72,7 @@ class pos_box_out(osv.osv_memory):
vals = {}
statement_obj = self.pool.get('account.bank.statement')
statement_line_obj = self.pool.get('account.bank.statement.line')
product_obj = self.pool.get('product.template')
productp_obj = self.pool.get('product.product')
product_obj = self.pool.get('product.product')
res_obj = self.pool.get('res.users')
for data in self.read(cr, uid, ids, context=context):
curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id
@ -84,8 +83,8 @@ class pos_box_out(osv.osv_memory):
stat_done = statement_obj.browse(cr, uid, done_statmt, context=context)
address_u = res_obj.browse(cr, uid, uid, context=context).address_id
am = 0.0
amount_check = productp_obj.browse(cr, uid, data['product_id'], context=context).am_out or False
product = product_obj.browse(cr, uid, data['product_id'], context=context)
amount_check = product.am_out or False
for st in stat_done:
for s in st.line_ids:
if address_u and s.partner_id == address_u.partner_id and s.am_out:
@ -94,9 +93,9 @@ class pos_box_out(osv.osv_memory):
val = (res_obj.browse(cr, uid, uid).company_id.max_diff or 0.0) + am
raise osv.except_osv(_('Error !'), _('The maximum value you can still withdraw is exceeded. \n Remaining value is equal to %d ')%(val))
acc_id = product_obj.browse(cr, uid, data['product_id'], context=context).property_account_income
acc_id = product.property_account_income
if not acc_id:
raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product_obj.browse(cr, uid, data['product_id'], context=context).name))
raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product.name))
if not statement_id:
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
if statement_id:
@ -116,10 +115,10 @@ class pos_box_out(osv.osv_memory):
if data['amount'] > 0:
amount = -data['amount']
vals['amount'] = amount
if productp_obj.browse(cr, uid, data['product_id'], context=context).am_out:
if product.am_out:
vals['am_out'] = True
vals['ref'] = data['ref'] or ''
vals['name'] = "%s: %s " % (product_obj.browse(cr, uid, data['product_id'], context=context).name, data['name'].decode('utf8'))
vals['name'] = "%s: %s " % (product.name, data['name'])
address_u = res_obj.browse(cr, uid, uid, context=context).address_id
if address_u:
vals['partner_id'] = address_u.partner_id and address_u.partner_id.id or None

View File

@ -512,13 +512,13 @@ class stock_warehouse_orderpoint(osv.osv):
'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'product_min_qty': fields.float('Min Quantity', required=True,
help="When the virtual stock goes belong the Min Quantity, OpenERP generates "\
help="When the virtual stock goes below the Min Quantity specified for this field, OpenERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'product_max_qty': fields.float('Max Quantity', required=True,
help="When the virtual stock goes belong the Max Quantity, OpenERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
help="When the virtual stock goes below the Min Quantity, OpenERP generates "\
"a procurement to bring the virtual stock to the Quantity specified as Max Quantity."),
'qty_multiple': fields.integer('Qty Multiple', required=True,
help="The procurement quantity will by rounded up to this multiple."),
help="The procurement quantity will be rounded up to this multiple."),
'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"),
'company_id': fields.many2one('res.company','Company',required=True),
'procurement_draft_ids': fields.function(_get_draft_procurements, method=True, type='many2many', relation="procurement.order", \

View File

@ -10,9 +10,10 @@
<form string="Empty Timebox">
<group width="345" height="70">
<label string="Timebox Empty Process Completed Successfully." />
<newline/>
<newline/>
<separator colspan="4"/>
<button icon="gtk-ok" special="cancel" string="_Ok" colspan="1"/><label colspan="1"/>
</group>
</group>
</form>
</field>
</record>

View File

@ -11,6 +11,7 @@
<field name="timebox_id" widget="selection"/>
<field name="timebox_to_id" widget="selection"/>
<field colspan="4" name="task_ids" nolabel="1" domain="[('timebox_id','=',timebox_id),('state','=','open')]" />
<separator colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button name="process" icon="gtk-ok" string="Add to Timebox" type="object" />

View File

@ -63,7 +63,7 @@
<field domain="[('project_id','=',project_id), ('state','in', ['draft','open'])]" name="sprint_id" select="1"/>
<button name="%(action_postpone_wizard)d" string="Postpone" type="action"
help="Postpone backlog" colspan="2"
icon="gtk-convert" attrs="{'invisible':[('state','=','done')]}"/>
icon="gtk-convert" attrs="{'invisible':[('state','in',['done', 'cancel'])]}"/>
<field name="user_id" select="1"/>
<field name="sequence" groups="base.group_extended"/>
<field name="create_date"/>

View File

@ -225,7 +225,7 @@
</group>
<group colspan="2" col="2">
<field name="date_from"/>
<field name="calendar_id" string="Working Period" readonly='1'/>
<field name="calendar_id" string="Working Period"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<group colspan="2" col="2">

View File

@ -1180,12 +1180,14 @@ class sale_config_picking_policy(osv.osv_memory):
'picking_policy': fields.selection([
('direct', 'Direct Delivery'),
('one', 'All at Once')
], 'Picking Default Policy', required=True, help="The Shipping Policy is used to configure per order if you want to deliver as soon as possible when one product is available or you wait that all products are available.."),
], 'Picking Default Policy', required=True, help="If you are sure that you have enough stock to send complete order at once please select 'All at Once'. If you want to send the order in the partial shipments please select 'Direct Delivery'..."),
'order_policy': fields.selection([
('manual', 'Invoice Based on Sales Orders'),
('picking', 'Invoice Based on Deliveries'),
], 'Shipping Default Policy', required=True,
help="You can generate invoices based on sales orders or based on shippings."),
help="""The Shipping Policy is used to synchronise invoice and delivery operations.
- The "Invoice Based on Sales Orders" option will create the picking order directly and wait for the user to manually click on the 'Invoice' button to generate the draft invoice.
- The "Invoice Based on Deliveries" option is used to create an invoice during the picking process."""),
'step': fields.selection([
('one', 'Delivery Order Only'),
('two', 'Picking List & Delivery Order')

View File

@ -3,6 +3,7 @@
"access_stock_incoterms_manager","stock.incoterms manager","model_stock_incoterms","stock.group_stock_manager",1,1,1,1
"access_stock_warehouse_manager","stock.warehouse.manager","model_stock_warehouse","stock.group_stock_manager",1,1,1,1
"access_stock_warehouse_user","stock.warehouse.user","model_stock_warehouse","base.group_user",1,0,0,0
"access_stock_location__partner_manager","stock.location.partner.manager","model_stock_location","base.group_partner_manager",1,1,1,1
"access_stock_location_manager","stock.location.manager","model_stock_location","stock.group_stock_manager",1,1,1,1
"access_stock_location_user","stock.location.user","model_stock_location","base.group_user",1,0,0,0
"access_stock_journal_user","stock.journal.user","model_stock_journal","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_stock_incoterms_manager stock.incoterms manager model_stock_incoterms stock.group_stock_manager 1 1 1 1
4 access_stock_warehouse_manager stock.warehouse.manager model_stock_warehouse stock.group_stock_manager 1 1 1 1
5 access_stock_warehouse_user stock.warehouse.user model_stock_warehouse base.group_user 1 0 0 0
6 access_stock_location__partner_manager stock.location.partner.manager model_stock_location base.group_partner_manager 1 1 1 1
7 access_stock_location_manager stock.location.manager model_stock_location stock.group_stock_manager 1 1 1 1
8 access_stock_location_user stock.location.user model_stock_location base.group_user 1 0 0 0
9 access_stock_journal_user stock.journal.user model_stock_journal base.group_user 1 0 0 0