[MERGE] merged the dev3 branch

bzr revid: qdp-launchpad@tinyerp.com-20110117180222-rvby5kh871sxfoyh
This commit is contained in:
qdp-launchpad@tinyerp.com 2011-01-17 19:02:22 +01:00
commit 717ea6f930
23 changed files with 83 additions and 65 deletions

View File

@ -1130,7 +1130,7 @@ class account_move(osv.osv):
'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}, select=True),
'narration':fields.text('Narration'),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
}

View File

@ -494,12 +494,12 @@ class account_move_line(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),
'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
'date_maturity': fields.date('Due date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
'date': fields.related('move_id','date', string='Effective date', type='date', required=True,
'date_maturity': fields.date('Due date', select=True ,help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
'date': fields.related('move_id','date', string='Effective date', type='date', required=True, select=True,
store = {
'account.move': (_get_move_lines, ['date'], 20)
}),
'date_created': fields.date('Creation date'),
'date_created': fields.date('Creation date', select=True),
'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'),
'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation')], 'Centralisation', size=6),
'balance': fields.function(_balance, fnct_search=_balance_search, method=True, string='Balance'),
@ -901,7 +901,8 @@ class account_move_line(osv.osv):
if context.get('account_id', False):
cr.execute('SELECT code FROM account_account WHERE id = %s', (context['account_id'], ))
res = cr.fetchone()
res = _('Entries: ')+ (res[0] or '')
if res:
res = _('Entries: ')+ (res[0] or '')
return res
if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
return False

View File

@ -558,6 +558,7 @@
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="currency" invisible="1"/>
<field name='company_id' widget="selection" groups="base.group_multi_company" />
</group>
<notebook colspan="4">
<page string="Transaction" name="statement_line_ids">
@ -2572,7 +2573,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="type" on_change="onchange_type(partner_id, type)"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
<field name="analytic_account_id" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]" groups="analytic.group_analytic_accounting" />
<field name="amount"/>
</tree>
<form string="Statement lines">
@ -2582,7 +2583,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="type" on_change="onchange_type(partner_id, type)"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
<field name="analytic_account_id" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]" groups="analytic.group_analytic_accounting" />
<field name="amount"/>
<field name="sequence"/>
<separator colspan="4" string="Notes"/>

View File

@ -211,8 +211,8 @@ class account_invoice(osv.osv):
\n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \
\n* The \'Paid\' state is set automatically when invoice is paid.\
\n* The \'Cancelled\' state is used when user cancel invoice.'),
'date_invoice': fields.date('Invoice Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, help="Keep empty to use the current date"),
'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]},
'date_invoice': fields.date('Invoice Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="Keep empty to use the current date"),
'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True,
help="If you use payment terms, the due date will be computed automatically at the generation "\
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. The payment term may compute several due dates, for example 50% now, 50% in one month."),
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}),

View File

@ -628,7 +628,7 @@ class account_analytic_account_summary_month(osv.osv):
tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_month')
cr.execute('CREATE VIEW account_analytic_analysis_summary_month AS (' \
'SELECT ' \
'(TO_NUMBER(TO_CHAR(d.month, \'YYYYMM\'), \'999999\') + (d.account_id * 1000000))::integer AS id, ' \
'(TO_NUMBER(TO_CHAR(d.month, \'YYYYMM\'), \'999999\') + (d.account_id * 1000000::bigint))::bigint AS id, ' \
'd.account_id AS account_id, ' \
'TO_CHAR(d.month, \'Mon YYYY\') AS month, ' \
'TO_NUMBER(TO_CHAR(d.month, \'YYYYMM\'), \'999999\') AS month_id, ' \

View File

@ -54,7 +54,7 @@ class account_move_line(osv.osv):
_inherit = 'account.move.line'
_columns = {
'followup_line_id': fields.many2one('account_followup.followup.line', 'Follow-up Level'),
'followup_date': fields.date('Latest Follow-up'),
'followup_date': fields.date('Latest Follow-up', select=True),
}
account_move_line()

View File

@ -181,7 +181,7 @@ class account_voucher(osv.osv):
('receipt','Receipt'),
],'Default Type', readonly=True, states={'draft':[('readonly',False)]}),
'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
'date':fields.date('Date', readonly=True, select=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=True, states={'draft':[('readonly',False)]}),
@ -218,7 +218,7 @@ class account_voucher(osv.osv):
],'Payment', select=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}),
'pre_line':fields.boolean('Previous Payments ?', required=False),
'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}),
'date_due': fields.date('Due Date', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'payment_option':fields.selection([
('without_writeoff', 'Keep Open'),
('with_writeoff', 'Reconcile with Write-Off'),

View File

@ -60,7 +60,7 @@ class account_analytic_account(osv.osv):
return res
where_date = ''
where_clause_args = [tuple(child_ids)]
where_clause_args = [tuple(child_ids)]
if context.get('from_date', False):
where_date += " AND l.date >= %s"
where_clause_args += [context['from_date']]
@ -71,20 +71,20 @@ class account_analytic_account(osv.osv):
SELECT a.id,
sum(
CASE WHEN l.amount > 0
THEN l.amount
THEN l.amount
ELSE 0.0
END
) as debit,
sum(
CASE WHEN l.amount < 0
THEN -l.amount
ELSE 0.0
ELSE 0.0
END
) as credit,
COALESCE(SUM(l.amount),0) AS balance,
COALESCE(SUM(l.unit_amount),0) AS quantity
FROM account_analytic_account a
LEFT JOIN account_analytic_line l ON (a.id = l.account_id)
FROM account_analytic_account a
LEFT JOIN account_analytic_line l ON (a.id = l.account_id)
WHERE a.id IN %s
""" + where_date + """
GROUP BY a.id""", where_clause_args)
@ -128,7 +128,7 @@ class account_analytic_account(osv.osv):
'contact_id': fields.many2one('res.partner.address', 'Contact'),
'user_id': fields.many2one('res.users', 'Account Manager'),
'date_start': fields.date('Date Start'),
'date': fields.date('Date End'),
'date': fields.date('Date End', select=True),
'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts.
'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
help='* When an account is created its in \'Draft\' state.\
@ -230,7 +230,7 @@ class account_analytic_line(osv.osv):
_columns = {
'name': fields.char('Description', size=256, required=True),
'date': fields.date('Date', required=True, select=1),
'date': fields.date('Date', required=True, select=True),
'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),

View File

@ -29,6 +29,7 @@ from report.interface import report_rml
from report.interface import toxml
from report import report_sxw
from tools import ustr
one_day = relativedelta(days=1)
month2name = [0, 'January', 'February', 'March', 'April', 'May', 'Jun', 'July', 'August', 'September', 'October', 'November', 'December']
@ -60,7 +61,7 @@ class report_custom(report_rml):
<name>%s</name>
%%s
</user>
''' % (toxml(emp['name']))
''' % (ustr(toxml(emp['name'])))
today, tomor = month, month + one_day
while today.month == month.month:
#### Work hour calculation

View File

@ -58,7 +58,7 @@ class report_custom(report_rml):
<name>%s</name>
%%s
</user>
''' % toxml(emp['name'])
''' % ustr(toxml(emp['name']))
while monday != last_monday:
#### Work hour calculation
sql = '''

View File

@ -14,6 +14,12 @@
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('base.group_hr_manager'))]"/>
</record>
<record id="property_rule_attendace_employee" model="ir.rule">
<field name="name">Employee Attendance</field>
<field model="ir.model" name="model_id" ref="model_hr_attendance"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
</data>

View File

@ -143,7 +143,7 @@ class hr_evaluation(osv.osv):
_description = "Employee Evaluation"
_rec_name = 'employee_id'
_columns = {
'date': fields.date("Evaluation Deadline", required=True),
'date': fields.date("Evaluation Deadline", required=True, select=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'note_summary': fields.text('Evaluation Summary'),
'note_action': fields.text('Action Plan',
@ -165,7 +165,7 @@ class hr_evaluation(osv.osv):
('done','Done'),
('cancel','Cancelled'),
], 'State', required=True, readonly=True),
'date_close': fields.date('Ending Date'),
'date_close': fields.date('Ending Date', select=True),
'progress': fields.float("Progress"),
}
_defaults = {

View File

@ -60,12 +60,12 @@ class hr_expense_expense(osv.osv):
'name': fields.char('Description', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),
'ref': fields.char('Reference', size=32),
'date': fields.date('Date'),
'date': fields.date('Date', select=True),
'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is invoiced"),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'user_id': fields.many2one('res.users', 'User', required=True),
'date_confirm': fields.date('Confirmation Date', help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
'date_valid': fields.date('Validation Date', help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."),
'date_confirm': fields.date('Confirmation Date', select=True, help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
'date_valid': fields.date('Validation Date', select=True, help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."),
'user_valid': fields.many2one('res.users', 'Validation User'),
'account_move_id': fields.many2one('account.move', 'Ledger Posting'),
'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ),
@ -155,7 +155,9 @@ class hr_expense_expense(osv.osv):
'account_analytic_id': l.analytic_account.id,
}))
if not exp.employee_id.address_home_id:
raise osv.except_osv(_('Error !'), _('The employee must have a Home address'))
raise osv.except_osv(_('Error !'), _('The employee must have a Home address.'))
if not exp.employee_id.address_home_id.partner_id:
raise osv.except_osv(_('Error !'), _("The employee's home address must have a partner linked."))
acc = exp.employee_id.address_home_id.partner_id.property_account_payable.id
payment_term_id = exp.employee_id.address_home_id.partner_id.property_payment_term.id
inv = {
@ -240,19 +242,11 @@ class hr_expense_line(osv.osv):
_order = "sequence, date_value desc"
def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
if context is None:
ctx = {}
else:
# we only want to update it locally
ctx = context.copy()
res = {}
if product_id:
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
res['name'] = product.name
# Compute based on pricetype of employee company
ctx['currency_id'] = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).user_id.company_id.currency_id.id
amount_unit = product.price_get('standard_price', ctx)[product.id]
amount_unit = product.price_get('standard_price', context=context)[product.id]
res['unit_amount'] = amount_unit
if not uom_id:
res['uom_id'] = product.uom_id.id

View File

@ -78,15 +78,15 @@
<notebook colspan="4">
<page string="Description">
<newline/>
<field colspan="4" name="line_ids" nolabel="1">
<field colspan="4" name="line_ids" nolabel="1" context="{'currency_id': currency_id}">
<form string="Expense Lines">
<group col="6" colspan="4">
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)"/>
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)"/>
<field name="name" colspan="4"/>
<newline/>
<field name="unit_amount"/>
<field name="unit_quantity"/>
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)"/>
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)"/>
</group>
<group colspan="2" col="2" groups="analytic.group_analytic_accounting">
<separator string="Customer Project" colspan="2"/>

View File

@ -14,6 +14,12 @@
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('base.group_hr_manager'))]"/>
</record>
<record id="property_rule_expense_employee" model="ir.rule">
<field name="name">Employee Expense</field>
<field model="ir.model" name="model_id" ref="model_hr_expense_expense"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
</data>
</openerp>

View File

@ -29,6 +29,7 @@ from report.interface import toxml
import pooler
import time
from report import report_sxw
from tools import ustr
def lengthmonth(year, month):
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@ -76,7 +77,7 @@ def emp_create_xml(self, cr, uid, dept, holiday_type, row_id, empid, name, som,
%s
<employee row="%d" id="%d" name="%s" sum="%s">
</employee>
''' % (data_xml,row_id,dept, toxml(name),count)
''' % (data_xml,row_id,dept, ustr(toxml(name)),count)
return xml
@ -244,7 +245,7 @@ class report_custom(report_rml):
%s
%s
</report>
''' % (header_xml,months_xml,date_xml, emp_xml)
''' % (header_xml,months_xml,date_xml, ustr(emp_xml))
return xml

View File

@ -14,6 +14,12 @@
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(6,0,[ref('base.group_hr_manager')])]"/>
</record>
<record id="property_rule_holidays_employee" model="ir.rule">
<field name="name">Employee Holidays</field>
<field model="ir.model" name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
</data>
</openerp>

View File

@ -126,7 +126,7 @@ class hr_applicant(crm.crm_case, osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
domain="[('partner_id','=',partner_id)]"),
'create_date': fields.datetime('Creation Date', readonly=True),
'create_date': fields.datetime('Creation Date', readonly=True, select=True),
'write_date': fields.datetime('Update Date', readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True,
@ -137,8 +137,8 @@ class hr_applicant(crm.crm_case, osv.osv):
'company_id': fields.many2one('res.company', 'Company'),
'user_id': fields.many2one('res.users', 'Responsible'),
# Applicant Columns
'date_closed': fields.datetime('Closed', readonly=True),
'date_open': fields.datetime('Opened', readonly=True),
'date_closed': fields.datetime('Closed', readonly=True, select=True),
'date_open': fields.datetime('Opened', readonly=True, select=True),
'date': fields.datetime('Date'),
'date_action': fields.date('Next Action Date'),
'title_action': fields.char('Next Action', size=64),

View File

@ -27,6 +27,7 @@ from tools.translate import _
import time
import pooler
from report import report_sxw
from tools import ustr
def lengthmonth(year, month):
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
@ -49,7 +50,7 @@ class report_custom(report_rml):
emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
user_id = emp_obj.browse(cr, uid, emp_id).user_id.id
empl_name = emp_obj.browse(cr, uid, emp_id).name
# Computing the dates (start of month: som, and end of month: eom)
som = datetime.date(data['form']['year'], data['form']['month'], 1)
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
@ -109,7 +110,7 @@ class report_custom(report_rml):
<employee>%s</employee>
%s
</report>
''' % (header_xml,toxml(empl_name), '\n'.join(date_xml) + '\n'.join(account_xml))
''' % (header_xml, ustr(toxml(empl_name)), '\n'.join(date_xml) + '\n'.join(account_xml))
return xml
report_custom('report.hr.analytical.timesheet', 'hr.employee', '', 'addons/hr_timesheet/report/user_timesheet.xsl')

View File

@ -26,6 +26,7 @@ import time
import pooler
from tools.translate import _
from report import report_sxw
from tools import ustr
def lengthmonth(year, month):
@ -111,7 +112,7 @@ class report_custom(report_rml):
%s
%s
</report>
''' % (header_xml,date_xml, emp_xml)
''' % (header_xml,date_xml, ustr(emp_xml))
return xml
report_custom('report.hr.analytical.timesheet_users', 'hr.employee', '', 'addons/hr_timesheet/report/users_timesheet.xsl')

View File

@ -262,7 +262,7 @@ class hr_timesheet_sheet(osv.osv):
'user_id': fields.related('employee_id', 'user_id', type="many2one", relation="res.users", store=True, string="User", required=False, readonly=True),#fields.many2one('res.users', 'User', required=True, select=1, states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
'date_from': fields.date('Date from', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
'date_to': fields.date('Date to', required=True, select=1, readonly=True, states={'new':[('readonly', False)]}),
'date_current': fields.date('Current date', required=True),
'date_current': fields.date('Current date', required=True, select=1),
'timesheet_ids' : one2many_mod('hr.analytic.timesheet', 'sheet_id',
'Timesheet lines', domain=[('date', '=', time.strftime('%Y-%m-%d'))],
readonly=True, states={

View File

@ -33,7 +33,7 @@ class pos_config_journal(osv.osv):
""" Point of Sale journal configuration"""
_name = 'pos.config.journal'
_description = "Journal Configuration"
_columns = {
'name': fields.char('Description', size=64),
'code': fields.char('Code', size=64),
@ -46,7 +46,7 @@ pos_config_journal()
class pos_company_discount(osv.osv):
""" Company Discount and Cashboxes """
_inherit = 'res.company'
_columns = {
'company_discount': fields.float('Max Discount(%)', digits_compute=dp.get_precision('Point Of Sale')),
'max_diff': fields.float('Max Difference for Cashboxes', digits_compute=dp.get_precision('Point Of Sale Discount')),
@ -247,14 +247,14 @@ class pos_order(osv.osv):
'num_sale': fields.char('Internal Note', size=64),
'shop_id': fields.many2one('sale.shop', 'Shop', required=True,
states={'draft': [('readonly', False)]}, readonly=True),
'date_order': fields.datetime('Date Ordered', readonly=True),
'date_order': fields.datetime('Date Ordered', readonly=True, select=True),
'date_validation': fields.function(_get_date_payment,
method=True,
string='Validation Date',
type='date', store=True),
type='date', select=True, store=True),
'date_payment': fields.function(_get_date_payment2, method=True,
string='Payment Date',
type='date', store=True),
type='date', select=True, store=True),
'date_validity': fields.date('Validity Date', required=True),
'user_id': fields.many2one('res.users', 'Connected Salesman', help="Person who uses the the cash register. It could be a reliever, a student or an interim employee."),
'user_salesman_id': fields.many2one('res.users', 'Cashier', required=True, help="User who is logged into the system."),
@ -332,7 +332,7 @@ class pos_order(osv.osv):
def test_order_lines(self, cr, uid, order, context=None):
""" Test order line is created or not for the order
""" Test order line is created or not for the order
@param name: Names of fields.
@return: True
"""
@ -573,9 +573,9 @@ class pos_order(osv.osv):
return statement_id
def add_product(self, cr, uid, order_id, product_id, qty, context=None):
"""Create a new order line the order"""
line_obj = self.pool.get('pos.order.line')
values = self.read(cr, uid, order_id, ['partner_id', 'pricelist_id'])
@ -596,9 +596,9 @@ class pos_order(osv.osv):
return order_line_id, price
def refund(self, cr, uid, ids, context=None):
"""Create a copy of order for refund order"""
clone_list = []
line_obj = self.pool.get('pos.order.line')
@ -623,9 +623,9 @@ class pos_order(osv.osv):
return clone_list
def action_invoice(self, cr, uid, ids, context=None):
"""Create a invoice of order """
inv_ref = self.pool.get('account.invoice')
inv_line_ref = self.pool.get('account.invoice.line')
product_obj = self.pool.get('product.product')

View File

@ -185,7 +185,7 @@ class sale_order(osv.osv):
for line in self.pool.get('sale.order.line').browse(cr, uid, ids, context=context):
result[line.order_id.id] = True
return result.keys()
_columns = {
'name': fields.char('Order Reference', size=64, required=True,
readonly=True, states={'draft': [('readonly', False)]}, select=True),
@ -202,9 +202,9 @@ class sale_order(osv.osv):
('done', 'Done'),
('cancel', 'Cancelled')
], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
'date_order': fields.date('Ordered Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'create_date': fields.date('Creation Date', readonly=True, help="Date on which sales order is created."),
'date_confirm': fields.date('Confirmation Date', readonly=True, help="Date on which sales order is confirmed."),
'date_order': fields.date('Ordered Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)]}),
'create_date': fields.date('Creation Date', readonly=True, select=True, help="Date on which sales order is created."),
'date_confirm': fields.date('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed."),
'user_id': fields.many2one('res.users', 'Salesman', states={'draft': [('readonly', False)]}, select=True),
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)]}, required=True, change_default=True, select=True),
'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sales order."),