[Merge] Merge with main addons.
bzr revid: mdi@tinyerp.com-20120530052856-dk8mfa6h6i5shs95
This commit is contained in:
commit
7a7661fa79
|
@ -201,17 +201,18 @@ class account_invoice(osv.osv):
|
|||
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('cancel','Cancelled'),
|
||||
('proforma','Pro-forma'),
|
||||
('proforma2','Pro-forma'),
|
||||
('open','Open'),
|
||||
('paid','Paid')
|
||||
],'Status', select=True, readonly=True,
|
||||
('paid','Paid'),
|
||||
('cancel','Cancelled'),
|
||||
],'State', select=True, readonly=True,
|
||||
help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \
|
||||
\n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \
|
||||
\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 the invoice is paid. Its related journal entries may or may not be reconciled. \
|
||||
\n* The \'Cancelled\' state is used when user cancel invoice.'),
|
||||
'sent': fields.boolean('Sent', readonly=True, help="It indicates that the invoice has been sent."),
|
||||
'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, 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 "\
|
||||
|
@ -286,6 +287,7 @@ class account_invoice(osv.osv):
|
|||
'check_total': 0.0,
|
||||
'internal_number': False,
|
||||
'user_id': lambda s, cr, u, c: u,
|
||||
'sent': False,
|
||||
}
|
||||
_sql_constraints = [
|
||||
('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'),
|
||||
|
@ -366,6 +368,47 @@ class account_invoice(osv.osv):
|
|||
else:
|
||||
raise orm.except_orm(_('Unknown Error'), str(e))
|
||||
|
||||
def invoice_print(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function prints the invoice and mark it as sent, so that we can see more easily the next step of the workflow
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
self.write(cr, uid, ids, {'sent': True}, context=context)
|
||||
datas = {
|
||||
'ids': ids,
|
||||
'model': 'account.invoice',
|
||||
'form': self.read(cr, uid, ids[0], context=context)
|
||||
}
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.invoice',
|
||||
'datas': datas,
|
||||
'nodestroy' : True
|
||||
}
|
||||
|
||||
def action_invoice_sent(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function opens a window to compose an email, with the edi invoice template message loaded by default
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
template = mod_obj.get_object_reference(cr, uid, 'account', 'email_template_edi_invoice')
|
||||
template_id = template and template[1] or False
|
||||
res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')
|
||||
res_id = res and res[1] or False
|
||||
ctx = dict(context, active_model='account.invoice', active_id=ids[0])
|
||||
ctx.update({'mail.compose.template_id': template_id})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'mail.compose.message',
|
||||
'views': [(res_id, 'form')],
|
||||
'view_id': res_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': ctx,
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
def confirm_paid(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -604,6 +647,7 @@ class account_invoice(osv.osv):
|
|||
'move_name':False,
|
||||
'internal_number': False,
|
||||
'period_id': False,
|
||||
'sent': False,
|
||||
})
|
||||
if 'date_invoice' not in default:
|
||||
default.update({
|
||||
|
@ -1669,4 +1713,14 @@ class res_partner(osv.osv):
|
|||
|
||||
res_partner()
|
||||
|
||||
class mail_message(osv.osv):
|
||||
_name = 'mail.message'
|
||||
_inherit = 'mail.message'
|
||||
|
||||
def _postprocess_sent_message(self, cr, uid, message, context=None):
|
||||
if message.model == 'account.invoice':
|
||||
self.pool.get('account.invoice').write(cr, uid, [message.res_id], {'sent':True}, context=context)
|
||||
return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context)
|
||||
|
||||
mail_message()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -146,11 +146,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button name="invoice_open" states="draft,proforma2" string="Approve"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid'/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid'/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<div class="oe_right">
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</div>
|
||||
|
@ -262,13 +262,15 @@
|
|||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
|
||||
<button name="action_invoice_sent" type="object" string="Send by Email" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}"/>
|
||||
<button name="invoice_print" string="Print Invoice" type="object" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}"/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid'/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='paid'/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
|
||||
<div class="oe_right">
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</div>
|
||||
|
@ -291,6 +293,7 @@
|
|||
<newline/>
|
||||
<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" groups="account.group_account_user"/>
|
||||
<field name="name"/>
|
||||
<field name="sent"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Invoice">
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
string="Invoices"
|
||||
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
|
||||
usage="default"
|
||||
multi="True"/>
|
||||
/>
|
||||
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
|
||||
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
from osv import fields, osv, orm
|
||||
from edi import EDIMixin
|
||||
from edi.models import edi
|
||||
|
||||
INVOICE_LINE_EDI_STRUCT = {
|
||||
'name': True,
|
||||
|
@ -71,6 +72,16 @@ INVOICE_EDI_STRUCT = {
|
|||
class account_invoice(osv.osv, EDIMixin):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
def action_invoice_sent(self, cr, uid, ids, context=None):
|
||||
""""Override this method to add a link to mail"""
|
||||
if context is None:
|
||||
context = {}
|
||||
invoice_objs = self.browse(cr, uid, ids, context=context)
|
||||
edi_token = self.pool.get('edi.document').export_edi(cr, uid, invoice_objs, context = context)[0]
|
||||
web_root_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
|
||||
ctx = dict(context, edi_web_url_view=edi.EDI_VIEW_WEB_URL % (web_root_url, cr.dbname, edi_token))
|
||||
return super(account_invoice, self).action_invoice_sent(cr, uid, ids, context=ctx)
|
||||
|
||||
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
|
||||
"""Exports a supplier or customer invoice"""
|
||||
edi_struct = dict(edi_struct or INVOICE_EDI_STRUCT)
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-05-15 06:17+0000\n"
|
||||
"PO-Revision-Date: 2012-05-29 21:49+0000\n"
|
||||
"Last-Translator: Akira Hiyama <Unknown>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-16 04:50+0000\n"
|
||||
"X-Generator: Launchpad (build 15247)\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-30 05:21+0000\n"
|
||||
"X-Generator: Launchpad (build 15316)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
|
@ -7024,7 +7024,7 @@ msgstr "財務レポートの階層"
|
|||
#: view:analytic.entries.report:0
|
||||
#: field:analytic.entries.report,product_uom_id:0
|
||||
msgid "Product UOM"
|
||||
msgstr "製品単位"
|
||||
msgstr "製品の単位"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,help:account.action_view_bank_statement_tree
|
||||
|
@ -7335,7 +7335,7 @@ msgstr ""
|
|||
#: field:account.invoice.tax,invoice_id:0
|
||||
#: model:ir.model,name:account.model_account_invoice_line
|
||||
msgid "Invoice Line"
|
||||
msgstr "請求行"
|
||||
msgstr "請求書行"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
|
@ -7590,7 +7590,7 @@ msgstr "仕訳帳の仕訳帳エントリー記帳"
|
|||
#. module: account
|
||||
#: view:product.product:0
|
||||
msgid "Sale Taxes"
|
||||
msgstr "消費税(売上)"
|
||||
msgstr "消費税"
|
||||
|
||||
#. module: account
|
||||
#: field:account.financial.report,name:0
|
||||
|
@ -10758,3 +10758,9 @@ msgstr "仕訳帳エントリーの買掛金、または買掛金の残差金額
|
|||
|
||||
#~ msgid "Description On Invoices"
|
||||
#~ msgstr "請求書説明"
|
||||
|
||||
#~ msgid "Write-Off journal"
|
||||
#~ msgstr "償却仕訳帳"
|
||||
|
||||
#~ msgid "Full Payment"
|
||||
#~ msgstr "全支払"
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-04-28 01:18+0000\n"
|
||||
"PO-Revision-Date: 2012-05-29 06:22+0000\n"
|
||||
"Last-Translator: Akira Hiyama <Unknown>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-04-29 04:45+0000\n"
|
||||
"X-Generator: Launchpad (build 15149)\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-30 05:21+0000\n"
|
||||
"X-Generator: Launchpad (build 15316)\n"
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: sql_constraint:purchase.order:0
|
||||
|
@ -35,7 +35,7 @@ msgstr "製品分類"
|
|||
#. module: account_anglo_saxon
|
||||
#: sql_constraint:stock.picking:0
|
||||
msgid "Reference must be unique per Company!"
|
||||
msgstr "参照は会社内ではユニークでなければいけません。"
|
||||
msgstr "参照は会社内で固有でなければいけません"
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: constraint:product.category:0
|
||||
|
@ -87,7 +87,7 @@ msgstr "出庫票"
|
|||
#. module: account_anglo_saxon
|
||||
#: sql_constraint:account.invoice:0
|
||||
msgid "Invoice Number must be unique per Company!"
|
||||
msgstr "請求書番号は会社ごとにユニークでなければいけません。"
|
||||
msgstr "請求書番号は会社ごとに固有である必要があります。"
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: help:product.category,property_account_creditor_price_difference_categ:0
|
||||
|
|
|
@ -780,7 +780,7 @@ class account_voucher(osv.osv):
|
|||
|
||||
def proforma_voucher(self, cr, uid, ids, context=None):
|
||||
self.action_move_line_create(cr, uid, ids, context=context)
|
||||
return True
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="invoice_open" position="after">
|
||||
<button name="invoice_pay_customer" type="object" string="Payment" states="open" icon="gtk-go-forward"/>
|
||||
<button name="invoice_pay_customer" type="object" string="Register Payment" states="open" icon="gtk-go-forward"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="invoice_open" position="after">
|
||||
<button name="invoice_pay_customer" type="object" string="Pay Invoice" states="open" icon="gtk-go-forward"/>
|
||||
<button name="invoice_pay_customer" type="object" string="Pay" states="open" icon="gtk-go-forward"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button name="proforma_voucher" string="Post" states="draft"/>
|
||||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to unreconcile this record ?"/>
|
||||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to unreconcile this record?"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma" />
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
|
||||
<div class="oe_right">
|
||||
|
|
|
@ -36,7 +36,7 @@ class invoice(osv.osv):
|
|||
'res_model': 'account.voucher',
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
'target': 'new',
|
||||
'domain': '[]',
|
||||
'context': {
|
||||
'default_partner_id': inv.partner_id.id,
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
import delivery
|
||||
import partner
|
||||
import wizard
|
||||
import report
|
||||
import sale
|
||||
import stock
|
||||
|
|
|
@ -37,7 +37,6 @@ When creating invoices from picking, OpenERP is able to add and compute the ship
|
|||
'init_xml': ['delivery_data.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/delivery_sale_order_view.xml',
|
||||
'delivery_report.xml',
|
||||
'delivery_view.xml',
|
||||
'partner_view.xml'
|
||||
|
|
|
@ -161,19 +161,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_order_withcarrier_form" model="ir.ui.view">
|
||||
<field name="name">delivery.sale.order_withcarrier.form.view</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="logistics" position="inside">
|
||||
<field name="id" invisible="True"/>
|
||||
<field name="carrier_id" context="{'order_id':active_id or False}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_withcarrier_out_form" model="ir.ui.view">
|
||||
<field name="name">delivery.stock.picking_withcarrier.out.form.view</field>
|
||||
<field name="type">form</field>
|
||||
|
@ -258,14 +245,18 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="edit_project_multicompany">
|
||||
<field name="name">sale.order.multicompany</field>
|
||||
<record id="view_order_withcarrier_form" model="ir.ui.view">
|
||||
<field name="name">delivery.sale.order_withcarrier.form.view</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='order_confirm']" position="after">
|
||||
<button name="%(action_delivery_cost)d" states="draft" string="Delivery Costs" type="action" icon="gtk-add" context="{'order_id':active_id}"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='bellow_the_lines_hook']" position="inside">
|
||||
<separator string="Delivery Costs" colspan="4"/>
|
||||
<field name="carrier_id" context="{'order_id':active_id or False}" colspan="2"/>
|
||||
<button name="delivery_set" states="draft" string="Add Now on the Sale Order" type="object" icon="gtk-add" colspan="2"/>
|
||||
<label string="if you don't click on 'Add Now', the delivery cost won't be added on the Sale Order, but will be added on the Delivery Order only" colspan="4"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields,osv
|
||||
|
||||
import time
|
||||
from osv import fields,osv
|
||||
from tools.translate import _
|
||||
|
||||
# Overloaded sale_order to manage carriers :
|
||||
class sale_order(osv.osv):
|
||||
|
@ -41,6 +43,39 @@ class sale_order(osv.osv):
|
|||
result.update(carrier_id=order.carrier_id.id)
|
||||
return result
|
||||
|
||||
def delivery_set(self, cr, uid, ids, context=None):
|
||||
order_obj = self.pool.get('sale.order')
|
||||
line_obj = self.pool.get('sale.order.line')
|
||||
grid_obj = self.pool.get('delivery.grid')
|
||||
carrier_obj = self.pool.get('delivery.carrier')
|
||||
acc_fp_obj = self.pool.get('account.fiscal.position')
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id)
|
||||
if not grid_id:
|
||||
raise osv.except_osv(_('No grid available !'), _('No grid matching for this carrier !'))
|
||||
|
||||
if not order.state in ('draft'):
|
||||
raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
|
||||
|
||||
grid = grid_obj.browse(cr, uid, grid_id, context=context)
|
||||
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
fpos = order.fiscal_position or False
|
||||
taxes_ids = acc_fp_obj.map_tax(cr, uid, fpos, taxes)
|
||||
#create the sale order line
|
||||
line_obj.create(cr, uid, {
|
||||
'order_id': order.id,
|
||||
'name': grid.carrier_id.name,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': grid.carrier_id.product_id.uom_id.id,
|
||||
'product_id': grid.carrier_id.product_id.id,
|
||||
'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
|
||||
'tax_id': [(6,0,taxes_ids)],
|
||||
'type': 'make_to_stock'
|
||||
})
|
||||
#remove the value of the carrier_id field on the sale order
|
||||
return self.write(cr, uid, ids, {'carrier_id': False}, context=context)
|
||||
#return {'type': 'ir.actions.act_window_close'} action reload?
|
||||
|
||||
sale_order()
|
||||
|
||||
|
|
|
@ -3,14 +3,8 @@
|
|||
-
|
||||
I add delivery cost in Sale order.
|
||||
-
|
||||
!python {model: delivery.sale.order}: |
|
||||
context.update({'active_ids': [ref("sale.order")]})
|
||||
-
|
||||
!record {model: delivery.sale.order, id: sale_delivery_carrier}:
|
||||
{}
|
||||
-
|
||||
!python {model: delivery.sale.order}: |
|
||||
self.delivery_set(cr, uid, [ref('sale_delivery_carrier')], context=context)
|
||||
!python {model: sale.order}: |
|
||||
self.delivery_set(cr, uid, [ref("sale.order")], context=context)
|
||||
-
|
||||
I check sale order after added delivery cost.
|
||||
-
|
||||
|
@ -35,7 +29,7 @@
|
|||
self.create_invoice(cr, uid, [wiz_id], {"active_ids": ship_ids, "active_id": ship_ids[0]})
|
||||
-
|
||||
I print a Delivery Order report.
|
||||
-
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
import netsvc, tools, os
|
||||
sale = self.pool.get('sale.order')
|
||||
|
@ -47,14 +41,8 @@
|
|||
-
|
||||
I add free delivery cost in Sale order.
|
||||
-
|
||||
!python {model: delivery.sale.order}: |
|
||||
context.update({'active_ids': [ref("sale.order2")]})
|
||||
-
|
||||
!record {model: delivery.sale.order, id: sale_delivery_carrier}:
|
||||
{}
|
||||
-
|
||||
!python {model: delivery.sale.order}: |
|
||||
self.delivery_set(cr, uid, [ref('sale_delivery_carrier')], context=context)
|
||||
!python {model: sale.order}: |
|
||||
self.delivery_set(cr, uid, [ref("sale.order2")], context=context)
|
||||
-
|
||||
I check sale order after added delivery cost.
|
||||
-
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import delivery_sale_order
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from tools.translate import _
|
||||
|
||||
from osv import osv, fields
|
||||
|
||||
class make_delivery(osv.osv_memory):
|
||||
_name = "delivery.sale.order"
|
||||
_description = 'Make Delievery'
|
||||
|
||||
_columns = {
|
||||
'carrier_id': fields.many2one('delivery.carrier','Delivery Method', required=True),
|
||||
}
|
||||
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(make_delivery, self).default_get(cr, uid, fields, context=context)
|
||||
order_obj = self.pool.get('sale.order')
|
||||
for order in order_obj.browse(cr, uid, context.get('active_ids', []), context=context):
|
||||
carrier = order.carrier_id.id
|
||||
if not carrier:
|
||||
carrier = order.partner_id.property_delivery_carrier.id
|
||||
res.update({'carrier_id': carrier})
|
||||
|
||||
return res
|
||||
|
||||
def view_init(self, cr , uid , fields, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
order_obj = self.pool.get('sale.order')
|
||||
for order in order_obj.browse(cr, uid, context.get('active_ids', []), context=context):
|
||||
if not order.state in ('draft'):
|
||||
raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
|
||||
pass
|
||||
|
||||
def delivery_set(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
rec_ids = context and context.get('active_ids',[])
|
||||
order_obj = self.pool.get('sale.order')
|
||||
line_obj = self.pool.get('sale.order.line')
|
||||
grid_obj = self.pool.get('delivery.grid')
|
||||
carrier_obj = self.pool.get('delivery.carrier')
|
||||
acc_fp_obj = self.pool.get('account.fiscal.position')
|
||||
order_objs = order_obj.browse(cr, uid, rec_ids, context=context)
|
||||
for datas in self.browse(cr, uid, ids, context=context):
|
||||
for order in order_objs:
|
||||
grid_id = carrier_obj.grid_get(cr, uid, [datas.carrier_id.id],order.partner_shipping_id.id)
|
||||
if not grid_id:
|
||||
raise osv.except_osv(_('No grid available !'), _('No grid matching for this carrier !'))
|
||||
|
||||
if not order.state in ('draft'):
|
||||
raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
|
||||
|
||||
grid = grid_obj.browse(cr, uid, grid_id, context=context)
|
||||
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
fpos = order.fiscal_position or False
|
||||
taxes_ids = acc_fp_obj.map_tax(cr, uid, fpos, taxes)
|
||||
line_obj.create(cr, uid, {
|
||||
'order_id': order.id,
|
||||
'name': grid.carrier_id.name,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': grid.carrier_id.product_id.uom_id.id,
|
||||
'product_id': grid.carrier_id.product_id.id,
|
||||
'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
|
||||
'tax_id': [(6,0,taxes_ids)],
|
||||
'type': 'make_to_stock'
|
||||
})
|
||||
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
make_delivery()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Delivery Sale Order -->
|
||||
|
||||
<record id="view_make_delivery_wizard" model="ir.ui.view">
|
||||
<field name="name">Delivery Costs</field>
|
||||
<field name="model">delivery.sale.order</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create Deliveries">
|
||||
<separator colspan="4" string="Delivery Method" />
|
||||
<field name="carrier_id" widget="selection"/>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
<group col="2" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="_Cancel" />
|
||||
<button name="delivery_set" string="_Apply"
|
||||
colspan="1" type="object" icon="gtk-apply" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_delivery_cost" model="ir.actions.act_window">
|
||||
<field name="name">Delivery Costs</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">delivery.sale.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_make_delivery_wizard"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -33,7 +33,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<h1 class="oe_edi_doc_title">Order <t t-esc="doc.name"/>: <t t-esc="_.str.sprintf('%.2f',doc.amount_total)"/> <t t-esc="doc.currency.code"/></h1>
|
||||
<t t-if="(doc.state == 'draft' or doc.state == 'sent') and doc.__model == 'sale.order'">
|
||||
<h1 class="oe_edi_doc_title">Quotation <t t-esc="doc.name"/>: <t t-esc="_.str.sprintf('%.2f',doc.amount_total)"/> <t t-esc="doc.currency.code"/></h1>
|
||||
</t>
|
||||
<t t-if="(doc.state == 'draft' or doc.state == 'sent') and doc.__model == 'purchase.order'">
|
||||
<h1 class="oe_edi_doc_title">Request for Quotation <t t-esc="doc.name"/>: <t t-esc="_.str.sprintf('%.2f',doc.amount_total)"/> <t t-esc="doc.currency.code"/></h1>
|
||||
</t>
|
||||
<t t-if="(doc.state != 'draft' and doc.state != 'sent')">
|
||||
<h1 class="oe_edi_doc_title">Order <t t-esc="doc.name"/>: <t t-esc="_.str.sprintf('%.2f',doc.amount_total)"/> <t t-esc="doc.currency.code"/></h1>
|
||||
</t>
|
||||
|
||||
<table width="100%" class="oe_edi_data oe_edi_shade">
|
||||
<tr class="oe_edi_floor">
|
||||
|
@ -116,7 +124,7 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="Edi.sale.order.sidebar">
|
||||
<t t-if="doc.order_policy && (doc.order_policy == 'prepaid' || doc.order_policy == 'manual')">
|
||||
<t t-if="doc.order_policy and (doc.order_policy == 'prepaid' || doc.order_policy == 'manual') and (doc.state != 'draft' and doc.state != 'sent')">
|
||||
<t t-if="doc.company_address.paypal_account || doc.company_address.bank_ids">
|
||||
<p class="oe_edi_sidebar_title">Pay Online</p>
|
||||
<t t-if="doc.company_address.paypal_account">
|
||||
|
|
|
@ -167,7 +167,6 @@ class hr_evaluation(osv.osv):
|
|||
('done','Done'),
|
||||
], 'Status', required=True, readonly=True),
|
||||
'date_close': fields.date('Ending Date', select=True),
|
||||
'progress': fields.float("Progress"),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
|
||||
|
@ -245,7 +244,6 @@ class hr_evaluation(osv.osv):
|
|||
return True
|
||||
|
||||
def button_done(self,cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids,{'progress': 1 * 100}, context=context)
|
||||
self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
|
||||
return True
|
||||
|
||||
|
@ -312,7 +310,6 @@ class hr_evaluation_interview(osv.osv):
|
|||
for id in self.browse(cr, uid, ids, context=context):
|
||||
flag = False
|
||||
wating_id = 0
|
||||
tot_done_req = 1
|
||||
if not id.evaluation_id.id:
|
||||
raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Appraisal."))
|
||||
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
|
||||
|
@ -322,11 +319,8 @@ class hr_evaluation_interview(osv.osv):
|
|||
continue
|
||||
if child.state != "done":
|
||||
flag = True
|
||||
else:
|
||||
tot_done_req += 1
|
||||
if not flag and wating_id:
|
||||
self.survey_req_waiting_answer(cr, uid, [wating_id], context=context)
|
||||
hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress': tot_done_req * 100 / len(records)}, context=context)
|
||||
self.write(cr, uid, ids, { 'state': 'done'}, context=context)
|
||||
return True
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="survey_2" model="survey">
|
||||
<field name="title">Employee Appraisal</field>
|
||||
<field name="title">Self Appraisal</field>
|
||||
<field name="max_response_limit">20</field>
|
||||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
|
@ -1157,37 +1157,11 @@ Once the form had been filled, the employee send it to his supervisor.
|
|||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="hr_evaluation_plan_phase_sendtosubordinates0" model="hr_evaluation.plan.phase">
|
||||
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
|
||||
<field name="name">Send to Subordinates</field>
|
||||
<field eval="0" name="send_anonymous_manager"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="action">bottom-up</field>
|
||||
<field eval="0" name="send_anonymous_employee"/>
|
||||
<field eval="0" name="send_answer_employee"/>
|
||||
<field name="survey_id" ref="hr_evaluation.survey_2"/>
|
||||
<field eval="0" name="send_answer_manager"/>
|
||||
<field eval="0" name="wait"/>
|
||||
</record>
|
||||
<record id="hr_evaluation_plan_phase_sendtomanagers0" model="hr_evaluation.plan.phase">
|
||||
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
|
||||
<field name="name">Send to Managers</field>
|
||||
<field eval="0" name="send_anonymous_manager"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="action">top-down</field>
|
||||
<field eval="0" name="send_anonymous_employee"/>
|
||||
<field eval="0" name="send_answer_employee"/>
|
||||
<field name="survey_id" ref="hr_evaluation.survey_2"/>
|
||||
<field eval="0" name="send_answer_manager"/>
|
||||
<field eval="0" name="wait"/>
|
||||
</record>
|
||||
<record id="hr_evaluation_plan_phase_sendtoemployee0" model="hr_evaluation.plan.phase">
|
||||
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
|
||||
<field name="name">Send to Employee</field>
|
||||
<field eval="0" name="send_anonymous_manager"/>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="action">self</field>
|
||||
<field eval="0" name="send_anonymous_employee"/>
|
||||
|
@ -1196,19 +1170,6 @@ Once the form had been filled, the employee send it to his supervisor.
|
|||
<field eval="0" name="send_answer_manager"/>
|
||||
<field eval="0" name="wait"/>
|
||||
</record>
|
||||
<record id="hr_evaluation_plan_phase_finalinterviewwithmanager0" model="hr_evaluation.plan.phase">
|
||||
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
|
||||
<field name="name">Final Interview With Manager</field>
|
||||
<field eval="0" name="send_anonymous_manager"/>
|
||||
<field eval="4" name="sequence"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="action">final</field>
|
||||
<field eval="0" name="send_anonymous_employee"/>
|
||||
<field eval="0" name="send_answer_employee"/>
|
||||
<field name="survey_id" ref="hr_evaluation.survey_2"/>
|
||||
<field eval="0" name="send_answer_manager"/>
|
||||
<field eval="1" name="wait"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<button name="button_draft" string="Reset to Draft" states="cancel" type="object"/>
|
||||
<button name="button_cancel" string="Cancel" states="draft,wait,progress" type="object"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,wait,done" statusbar_colors='{"progress":"blue"}'/>
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,progress,wait,done" statusbar_colors='{"progress":"blue"}'/>
|
||||
</div>
|
||||
<div class="oe_clear"/>
|
||||
</div>
|
||||
|
@ -172,21 +172,20 @@
|
|||
<field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
|
||||
<field name="plan_id"/>
|
||||
<field name="date"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<group col="2" colspan="1" attrs="{'invisible':['|', ('state','=','draft'), ('state', '=', 'wait')]}">
|
||||
<separator string="Ending Summary" colspan="2"/>
|
||||
<field name="rating" attrs="{'readonly':[('state','<>','progress')],'required':[('state','=','progress')]}"/>
|
||||
<field name="rating" attrs="{'readonly':[('state','<>','progress')]}"/>
|
||||
<field name="date_close" readonly="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Appraisal">
|
||||
<page string="Appraisal" attrs="{'invisible':[('state','=','draft')]}">
|
||||
<field name="survey_request_ids" nolabel="1" colspan="4" widget="one2many">
|
||||
<form string="Interview Appraisal">
|
||||
<group col="4" colspan="4">
|
||||
<field name="survey_id"/>
|
||||
<group col="2" colspan="2">
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
|
||||
</group>
|
||||
<field name="date_deadline"/>
|
||||
|
@ -198,15 +197,16 @@
|
|||
<separator string="Status" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="state"/>
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Internal Notes">
|
||||
<page string="Internal Notes" attrs="{'invisible':[('state','=','draft')]}">
|
||||
<field name="note_action" colspan="4" nolabel="1"
|
||||
groups="base.group_hr_manager"/>
|
||||
</page>
|
||||
<page string="Public Notes">
|
||||
<page string="Public Notes" attrs="{'invisible':[('state','=','draft')]}">
|
||||
<field name="note_summary" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -255,6 +255,9 @@
|
|||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
|
||||
help="Appraisal that overpassed the deadline" domain="[('date','<=',(datetime.date.today()).strftime('%%Y-%%m-%%d'))]" />
|
||||
<filter icon="terp-go-month" name="next_month" string=" Month+1"
|
||||
domain="[('date','<=', (datetime.date.today() + relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today() + relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d')),('state','=','draft')]"
|
||||
help="Appraisal during next month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id" />
|
||||
<field name="plan_id" widget="selection" />
|
||||
|
@ -279,6 +282,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
|
||||
<field name="context">{"search_default_next_month":1}</field>
|
||||
<field name="help">Each employee may be assigned an Appraisal Plan. Such a plan defines the frequency and the way you manage your periodic personnel evaluation. You will be able to define steps and attach interviews to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self-evaluation and final evaluation by the manager.</field>
|
||||
</record>
|
||||
|
||||
|
@ -292,28 +296,27 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Interview Appraisal">
|
||||
<group col="4" colspan="4">
|
||||
<field name="survey_id"/>
|
||||
<field name="evaluation_id"/>
|
||||
<group col="2" colspan="2">
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
|
||||
</group>
|
||||
<field name="date_deadline"/>
|
||||
<field name="response" readonly="1"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<group col="2" colspan="2">
|
||||
<button string="Send Reminder Email"
|
||||
name="%(mail.action_email_compose_message_wizard)d"
|
||||
icon="terp-mail-message-new" type="action"
|
||||
states="waiting_answer"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="date_deadline"/>
|
||||
<group col="4" colspan="4">
|
||||
<field name="survey_id"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<newline/>
|
||||
<field name="evaluation_id"/>
|
||||
<button string="Send Reminder Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action" states="waiting_answer"/>
|
||||
<newline/>
|
||||
<field name="response" readonly="1"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string="Status" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="state"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="waiting_answer,done"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" />
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
|
||||
<button string="Cancel" name="survey_req_cancel" states="draft,waiting_answer" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -330,11 +333,12 @@
|
|||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="response" readonly="1" invisible="True"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(mail.action_email_compose_message_wizard)d" string="Send Reminder Email" icon="terp-mail-message-new" type="action" colspan="2" states="waiting_answer"/>
|
||||
<field name="state"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" />
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -31,7 +31,6 @@ class hr_evaluation_report(osv.osv):
|
|||
'create_date': fields.date('Create Date', readonly=True),
|
||||
'delay_date':fields.float('Delay to Start', digits=(16,2),readonly=True),
|
||||
'overpass_delay':fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
|
||||
'progress_bar' : fields.float("Progress"),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'deadline': fields.date("Deadline", readonly=True),
|
||||
'request_id': fields.many2one('survey.request', 'Request_id', readonly=True),
|
||||
|
@ -77,7 +76,6 @@ class hr_evaluation_report(osv.osv):
|
|||
to_char(s.create_date, 'MM') as month,
|
||||
count(l.*) as nbr,
|
||||
s.state,
|
||||
s.progress as progress_bar,
|
||||
avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_date,
|
||||
avg(extract('epoch' from age(s.date,CURRENT_DATE)))/(3600*24) as overpass_delay
|
||||
from
|
||||
|
@ -96,7 +94,6 @@ class hr_evaluation_report(osv.osv):
|
|||
s.date_close,
|
||||
l.request_id,
|
||||
s.rating,
|
||||
s.progress,
|
||||
s.plan_id
|
||||
)
|
||||
""")
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
<field name="rating" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="nbr" sum="# of Requests"/>
|
||||
<field name="progress_bar" widget="progressbar"/>
|
||||
<field name="delay_date"/>
|
||||
<field name="overpass_delay"/>
|
||||
</tree>
|
||||
|
|
|
@ -25,7 +25,7 @@ access_survey_page_hr_user,survey.page.hr.user,survey.model_survey_page,base.gro
|
|||
access_survey_response_hr_user,survey.response.hr.user,survey.model_survey_response,base.group_hr_user,1,1,1,0
|
||||
access_survey_history_hr_user,survey.history.hr.user,survey.model_survey_history,base.group_hr_user,1,1,1,0
|
||||
access_survey_request_hr_user,survey.request.hr.user,survey.model_survey_request,base.group_hr_user,1,1,1,0
|
||||
access_survey_question_column_heading_hr_user,survey.question.column.heading.hr.user,survey.model_survey_question_column_heading,base.group_hr_user,1,0,0,0
|
||||
access_survey_question_column_heading_hr_user,survey.question.column.heading.hr.user,survey.model_survey_question_column_heading,base.group_hr_user,1,1,1,0
|
||||
access_survey_response_line_hr_user,survey.response.line.hr.user,survey.model_survey_response_line,base.group_hr_user,1,1,1,0
|
||||
access_survey_tbl_column_heading_hr_user,survey.tbl.column.heading.hr.user,survey.model_survey_tbl_column_heading,base.group_hr_user,1,1,1,0
|
||||
access_base_calendar_attendee_survey_user,base.calendar.calendar.attendee.survey.user,base_calendar.model_calendar_attendee,base.group_survey_user,1,1,1,0
|
||||
|
|
|
|
@ -14,7 +14,7 @@ msgstr ""
|
|||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-29 04:46+0000\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-30 05:21+0000\n"
|
||||
"X-Generator: Launchpad (build 15316)\n"
|
||||
|
||||
#. module: hr_expense
|
||||
|
|
|
@ -112,25 +112,24 @@ class hr_holidays(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'name': fields.char('Description', required=True, size=64),
|
||||
'state': fields.selection([('draft', 'New'), ('cancel', 'Cancelled'),('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
|
||||
('validate1', 'Waiting Second Approval'), ('validate', 'Approved')],
|
||||
'Status', readonly=True, help='The status is set to \'Draft\', when a holiday request is created.\
|
||||
\nThe status is \'Waiting Approval\', when holiday request is confirmed by user.\
|
||||
\nThe status is \'Refused\', when holiday request is refused by manager.\
|
||||
\nThe status is \'Approved\', when holiday request is approved by manager.'),
|
||||
'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved')],
|
||||
'State', readonly=True, help='The state is set to \'To Submit\', when a holiday request is created.\
|
||||
\nThe state is \'To Approve\', 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)]}, select=True),
|
||||
'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'),
|
||||
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, select=True),
|
||||
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'holiday_status_id': fields.many2one("hr.holidays.status", "Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('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 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 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)]}),
|
||||
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}),
|
||||
'number_of_days': fields.function(_compute_number_of_days, string='Number of Days', store=True),
|
||||
'case_id': fields.many2one('crm.meeting', 'Meeting'),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone", select=True),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone", select=True),
|
||||
'parent_id': fields.many2one('hr.holidays', 'Parent'),
|
||||
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
|
||||
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
|
||||
|
|
|
@ -56,11 +56,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Submit to Manager" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="refuse,validate" type="object" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="refuse,validate" type="object" groups="base.group_hr_user"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</div>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
|
||||
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
|
||||
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('holiday_type','=','category')]}">
|
||||
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}" groups="base.group_hr_user"/>
|
||||
|
@ -108,11 +108,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Submit to Manager" name="confirm" states="draft" type="workflow"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel,validate,refuse" type="object" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="cancel,validate,refuse" type="object" groups="base.group_hr_user"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</div>
|
||||
|
@ -132,7 +132,7 @@
|
|||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
|
||||
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}"/>
|
||||
<field name="department_id" attrs="{'readonly':['|', ('holiday_type','=','category'), ('state','not in' ,('draft', 'confirm'))]}"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<field name="double_validation" invisible="1"/>
|
||||
<newline/>
|
||||
|
@ -169,7 +169,7 @@
|
|||
<!--field name="type"/-->
|
||||
<field name="state"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -194,10 +194,10 @@
|
|||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -225,7 +225,7 @@
|
|||
<field name="manager_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="Submit to Manager" 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="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_user"/>
|
||||
</tree>
|
||||
|
@ -254,7 +254,7 @@
|
|||
<field name="user_id" invisible="1"/>
|
||||
<!--field name="type"/-->
|
||||
<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"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-02-13 04:47+0000\n"
|
||||
"Last-Translator: Jeff Wang <wjfonhand@hotmail.com>\n"
|
||||
"PO-Revision-Date: 2012-05-29 05:42+0000\n"
|
||||
"Last-Translator: ccdos <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-02-14 05:44+0000\n"
|
||||
"X-Generator: Launchpad (build 14781)\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-30 05:21+0000\n"
|
||||
"X-Generator: Launchpad (build 15316)\n"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: field:hr.analytic.timesheet,sheet_id:0 field:hr.attendance,sheet_id:0
|
||||
|
@ -61,7 +61,7 @@ msgstr "本年的计工单"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.transition,name:hr_timesheet_sheet.process_transition_tasktimesheet0
|
||||
msgid "Task timesheet"
|
||||
msgstr "工作记工单"
|
||||
msgstr "工作计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0
|
||||
|
@ -78,7 +78,7 @@ msgstr "请核实这表的总差异少于 %.2f !"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: selection:hr.timesheet.report,month:0 selection:timesheet.report,month:0
|
||||
msgid "March"
|
||||
msgstr "3月"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:timesheet.report:0 field:timesheet.report,cost:0
|
||||
|
@ -105,7 +105,7 @@ msgstr "公司"
|
|||
#: model:process.node,name:hr_timesheet_sheet.process_node_timesheet0
|
||||
#: view:timesheet.report:0
|
||||
msgid "Timesheet"
|
||||
msgstr "记工单"
|
||||
msgstr "计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0
|
||||
|
@ -120,7 +120,7 @@ msgstr "日期到"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.node,note:hr_timesheet_sheet.process_node_invoiceonwork0
|
||||
msgid "Based on the timesheet"
|
||||
msgstr "根据记工单"
|
||||
msgstr "根据计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 view:timesheet.report:0
|
||||
|
@ -173,7 +173,7 @@ msgstr "拒绝"
|
|||
#, python-format
|
||||
msgid ""
|
||||
"You cannot enter an attendance date outside the current timesheet dates!"
|
||||
msgstr "您不能输入一个超过当前记工单日期的考勤日期!"
|
||||
msgstr "您不能输入一个超过当前计工单日期的考勤日期!"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:ir.actions.act_window,help:hr_timesheet_sheet.action_hr_timesheet_current_open
|
||||
|
@ -185,8 +185,8 @@ msgid ""
|
|||
"the user and can be validated by his manager. If required, as defined on the "
|
||||
"project, you can generate the invoices based on the timesheet."
|
||||
msgstr ""
|
||||
"用\"我的记工单\"菜单开启您的记工单所以您能在系统预定你的活动。用相同方式,您能记录您的考勤(签入/签出)同时记录在不同项目的工作时间。在公司定义的期末"
|
||||
",确认用户的记工单和经由经理使其生效。如果需要,可以定义为一个项目,你能给这记工单开发票。"
|
||||
"用\"我的计工单\"菜单开启您的计工单所以您能在系统预定你的活动。用相同方式,您能记录您的考勤(签入/签出)同时记录在不同项目的工作时间。在公司定义的期末"
|
||||
",确认用户的记工单和经由经理使其生效。如果需要,可以定义为一个项目,你能给这计工单开发票。"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet.day:0
|
||||
|
@ -227,7 +227,7 @@ msgstr "警告!"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.node,note:hr_timesheet_sheet.process_node_attendance0
|
||||
msgid "Employee's timesheet entry"
|
||||
msgstr "员工记工单"
|
||||
msgstr "员工计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 field:hr.timesheet.report,account_id:0
|
||||
|
@ -259,7 +259,7 @@ msgstr " 月份 "
|
|||
#: model:ir.ui.menu,name:hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form
|
||||
#: view:res.company:0
|
||||
msgid "Timesheets"
|
||||
msgstr "记工单"
|
||||
msgstr "计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:process.node,name:hr_timesheet_sheet.process_node_confirmedtimesheet0
|
||||
|
@ -282,7 +282,7 @@ msgstr "确认"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: field:hr_timesheet_sheet.sheet,timesheet_ids:0
|
||||
msgid "Timesheet lines"
|
||||
msgstr "记工单明细"
|
||||
msgstr "计工单明细"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: constraint:res.company:0
|
||||
|
@ -343,7 +343,7 @@ msgstr "总时间"
|
|||
#: view:hr_timesheet_sheet.sheet:0
|
||||
#: model:ir.actions.act_window,name:hr_timesheet_sheet.act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet
|
||||
msgid "Timesheet Lines"
|
||||
msgstr "记工单明细"
|
||||
msgstr "计工单明细"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0
|
||||
|
@ -370,7 +370,7 @@ msgstr "无效操作!"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.transition,note:hr_timesheet_sheet.process_transition_validatetimesheet0
|
||||
msgid "The project manager validates the timesheets."
|
||||
msgstr "项目经理审核记工单"
|
||||
msgstr "项目经理审核计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: selection:hr.timesheet.report,month:0 selection:timesheet.report,month:0
|
||||
|
@ -403,7 +403,7 @@ msgstr "# 数量"
|
|||
#: view:hr_timesheet_sheet.sheet.day:0
|
||||
#: field:hr_timesheet_sheet.sheet.day,total_timesheet:0
|
||||
msgid "Total Timesheet"
|
||||
msgstr "总记工单"
|
||||
msgstr "总计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0
|
||||
|
@ -418,7 +418,7 @@ msgstr "签入"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: view:timesheet.report:0 field:timesheet.report,total_timesheet:0
|
||||
msgid "#Total Timesheet"
|
||||
msgstr "# 总记工单"
|
||||
msgstr "# 总计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:ir.model,name:hr_timesheet_sheet.model_hr_timesheet_current_open
|
||||
|
@ -451,7 +451,7 @@ msgstr "要为员工创建计工单,你要给该员工指定一个产品,例
|
|||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.current.open:0
|
||||
msgid "It will open your current timesheet"
|
||||
msgstr "它将开启您当前记工单"
|
||||
msgstr "它将开启您当前计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: code:addons/hr_timesheet_sheet/hr_timesheet_sheet.py:241
|
||||
|
@ -504,12 +504,12 @@ msgstr "开发票"
|
|||
msgid ""
|
||||
"The timesheet line represents the time spent by the employee on a specific "
|
||||
"service provided."
|
||||
msgstr "记工单明细代表员工在特定服务所花费的时间。"
|
||||
msgstr "计工单明细代表员工在特定服务所花费的时间。"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: constraint:hr_timesheet_sheet.sheet:0
|
||||
msgid "You must select a Current date which is in the timesheet dates !"
|
||||
msgstr "您选择的当前日期必须要在记工单里!"
|
||||
msgstr "您选择的当前日期必须要在计工单里!"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: field:hr_timesheet_sheet.sheet,name:0
|
||||
|
@ -523,7 +523,7 @@ msgid ""
|
|||
"in the system. It allows you to have a full overview of entries done by "
|
||||
"your employees. You can group them by specific selection criteria thanks to "
|
||||
"the search tool."
|
||||
msgstr "在系统里这报表分析创建的记工单,它可以使您一览您的员工的工作。您可以在搜索工具选择具体的标准来分组。"
|
||||
msgstr "在系统里这报表分析创建的计工单,它可以使您一览您的员工的工作。您可以在搜索工具选择具体的标准来分组。"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:timesheet.report:0 selection:timesheet.report,state:0
|
||||
|
@ -533,17 +533,17 @@ msgstr "草稿"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: field:res.company,timesheet_max_difference:0
|
||||
msgid "Timesheet allowed difference(Hours)"
|
||||
msgstr "记工单允许的差异(小时)"
|
||||
msgstr "计工单允许的差异(小时)"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:process.transition,note:hr_timesheet_sheet.process_transition_invoiceontimesheet0
|
||||
msgid "The invoice is created based on the timesheet."
|
||||
msgstr "这发票创建基于这记工单"
|
||||
msgstr "这发票创建基于这计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:process.node,name:hr_timesheet_sheet.process_node_drafttimesheetsheet0
|
||||
msgid "Draft Timesheet"
|
||||
msgstr "记工单草稿"
|
||||
msgstr "计工单草稿"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: selection:res.company,timesheet_range:0
|
||||
|
@ -574,13 +574,13 @@ msgstr "当前状态"
|
|||
#: code:addons/hr_timesheet_sheet/hr_timesheet_sheet.py:646
|
||||
#, python-format
|
||||
msgid "You cannot modify an entry in a confirmed timesheet !"
|
||||
msgstr "您不能修改一个已确认的记工单!"
|
||||
msgstr "您不能修改一个已确认的计工单!"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: model:ir.model,name:hr_timesheet_sheet.model_hr_timesheet_sheet_sheet_account
|
||||
#: model:ir.model,name:hr_timesheet_sheet.model_hr_timesheet_sheet_sheet_day
|
||||
msgid "Timesheets by Period"
|
||||
msgstr "记工单周期"
|
||||
msgstr "计工单周期"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 field:hr.timesheet.report,user_id:0
|
||||
|
@ -592,7 +592,7 @@ msgstr "用户"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet_sheet.act_hr_timesheet_sheet_sheet_by_account
|
||||
msgid "Timesheet by Account"
|
||||
msgstr "辅助核算项的记工单"
|
||||
msgstr "辅助核算项的计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: field:hr.timesheet.report,date:0 field:hr_timesheet_sheet.sheet.day,name:0
|
||||
|
@ -612,13 +612,13 @@ msgstr "增加筛选条件"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: field:res.company,timesheet_range:0
|
||||
msgid "Timesheet range"
|
||||
msgstr "记工单范围"
|
||||
msgstr "计工单范围"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: code:addons/hr_timesheet_sheet/hr_timesheet_sheet.py:548
|
||||
#, python-format
|
||||
msgid "You can not modify an entry in a confirmed timesheet !"
|
||||
msgstr "您不能修改一张已确认的记工单!"
|
||||
msgstr "您不能修改一张已确认的计工单!"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:board.board:0
|
||||
|
@ -646,7 +646,7 @@ msgid ""
|
|||
"Check your timesheets for a specific period. You can also encode time spent "
|
||||
"on a project (i.e. an analytic account) thus generating costs in the "
|
||||
"analytic account concerned."
|
||||
msgstr "在指定的周期检查您的记工单。您也可以在项目花费的时间进行编码(即辅助核算项)因此在这辅助核算项生成有关成本。"
|
||||
msgstr "在指定的周期检查您的计工单。您也可以在项目花费的时间进行编码(即辅助核算项)因此在这辅助核算项生成有关成本。"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: code:addons/hr_timesheet_sheet/hr_timesheet_sheet.py:237
|
||||
|
@ -728,7 +728,7 @@ msgstr "查找辅助核算项"
|
|||
msgid ""
|
||||
"Allowed difference in hours between the sign in/out and the timesheet "
|
||||
"computation for one sheet. Set this to 0 if you do not want any control."
|
||||
msgstr "签入/签出和在一个记工单里的容许的差异小时。如果您不想这样控制设为0."
|
||||
msgstr "签入/签出和在一个计工单里的容许的差异小时。如果您不想这样控制设为0."
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0 field:hr_timesheet_sheet.sheet,period_ids:0
|
||||
|
@ -789,13 +789,13 @@ msgstr "本月的计工单"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet.account:0
|
||||
msgid "Timesheet by Accounts"
|
||||
msgstr "辅助核算项记工单"
|
||||
msgstr "辅助核算项计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: code:addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py:51
|
||||
#, python-format
|
||||
msgid "Open Timesheet"
|
||||
msgstr "开始的记工单"
|
||||
msgstr "开始的计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 view:timesheet.report:0
|
||||
|
@ -817,21 +817,21 @@ msgid ""
|
|||
"* The 'Done' state is used when users timesheet is accepted by his/her "
|
||||
"senior."
|
||||
msgstr ""
|
||||
" * “草稿”状态用于一个新的和未确认的记工单。\n"
|
||||
"* \"已确认\"状态用于用户确认一个记工单。\n"
|
||||
"* “完成”状态用于用户记工单已被他/她的上级审核。"
|
||||
" * “草稿”状态用于一个新的和未确认的计工单。\n"
|
||||
"* \"已确认\"状态用于用户确认一个计工单。\n"
|
||||
"* “完成”状态用于用户计工单已被他/她的上级审核。"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0
|
||||
#: model:ir.actions.act_window,name:hr_timesheet_sheet.action_hr_timesheet_report_stat_all
|
||||
#: model:ir.ui.menu,name:hr_timesheet_sheet.menu_hr_timesheet_report_all
|
||||
msgid "Timesheet Analysis"
|
||||
msgstr "记工单分析"
|
||||
msgstr "计工单分析"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0
|
||||
msgid "Search Timesheet"
|
||||
msgstr "查找记工单"
|
||||
msgstr "查找计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet:0
|
||||
|
@ -841,7 +841,7 @@ msgstr "已确认的计工单"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:ir.model,name:hr_timesheet_sheet.model_hr_analytic_timesheet
|
||||
msgid "Timesheet Line"
|
||||
msgstr "记工单明细"
|
||||
msgstr "计工单明细"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 field:hr.timesheet.report,product_id:0
|
||||
|
@ -864,7 +864,7 @@ msgstr "说明"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.transition,note:hr_timesheet_sheet.process_transition_confirmtimesheet0
|
||||
msgid "The employee periodically confirms his own timesheets."
|
||||
msgstr "员工定期确认自己的记工单"
|
||||
msgstr "员工定期确认自己的计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: selection:hr.timesheet.report,month:0 selection:timesheet.report,month:0
|
||||
|
@ -884,7 +884,7 @@ msgstr "签出"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.transition,note:hr_timesheet_sheet.process_transition_tasktimesheet0
|
||||
msgid "Moves task entry into the timesheet line"
|
||||
msgstr "把工作调入记工单明细中"
|
||||
msgstr "把工作调入计工单明细中"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr_timesheet_sheet.sheet.day:0
|
||||
|
@ -895,7 +895,7 @@ msgstr "工作时长"
|
|||
#: model:ir.actions.act_window,name:hr_timesheet_sheet.action_timesheet_report_stat_all
|
||||
#: model:ir.ui.menu,name:hr_timesheet_sheet.menu_timesheet_report_all
|
||||
msgid "Timesheet Sheet Analysis"
|
||||
msgstr "记工单分析"
|
||||
msgstr "计工单分析"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: field:hr_timesheet_sheet.sheet,total_difference:0
|
||||
|
@ -1008,7 +1008,7 @@ msgstr "当前日期"
|
|||
#. module: hr_timesheet_sheet
|
||||
#: model:process.process,name:hr_timesheet_sheet.process_process_hrtimesheetprocess0
|
||||
msgid "Hr Timesheet"
|
||||
msgstr "人力资源 记工单"
|
||||
msgstr "人力资源 计工单"
|
||||
|
||||
#. module: hr_timesheet_sheet
|
||||
#: view:hr.timesheet.report:0 field:hr.timesheet.report,year:0
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,7 +14,7 @@ msgstr ""
|
|||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-29 04:45+0000\n"
|
||||
"X-Launchpad-Export-Date: 2012-05-30 05:21+0000\n"
|
||||
"X-Generator: Launchpad (build 15316)\n"
|
||||
|
||||
#. module: membership
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,6 +24,7 @@ from dateutil.relativedelta import relativedelta
|
|||
|
||||
from osv import fields, osv, orm
|
||||
from edi import EDIMixin
|
||||
from edi.models import edi
|
||||
from tools import DEFAULT_SERVER_DATE_FORMAT
|
||||
from tools.translate import _
|
||||
|
||||
|
@ -56,11 +57,22 @@ PURCHASE_ORDER_EDI_STRUCT = {
|
|||
'amount_total': True,
|
||||
'amount_untaxed': True,
|
||||
'amount_tax': True,
|
||||
'state':True,
|
||||
}
|
||||
|
||||
class purchase_order(osv.osv, EDIMixin):
|
||||
_inherit = 'purchase.order'
|
||||
|
||||
def wkf_send_rfq(self, cr, uid, ids, context=None):
|
||||
""""Override this method to add a link to mail"""
|
||||
if context is None:
|
||||
context = {}
|
||||
purchase_objs = self.browse(cr, uid, ids, context=context)
|
||||
edi_token = self.pool.get('edi.document').export_edi(cr, uid, purchase_objs, context = context)[0]
|
||||
web_root_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
|
||||
ctx = dict(context, edi_web_url_view=edi.EDI_VIEW_WEB_URL % (web_root_url, cr.dbname, edi_token))
|
||||
return super(purchase_order, self).wkf_send_rfq(cr, uid, ids, context=ctx)
|
||||
|
||||
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
|
||||
"""Exports a purchase order"""
|
||||
edi_struct = dict(edi_struct or PURCHASE_ORDER_EDI_STRUCT)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<!--Export edi document -->
|
||||
<!--
|
||||
<record id="ir_actions_server_edi_purchase" model="ir.actions.server">
|
||||
<field name="code">if not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='purchase.email_template_edi_purchase', context=context)</field>
|
||||
<field name="state">code</field>
|
||||
|
@ -10,6 +11,7 @@
|
|||
<field name="condition">True</field>
|
||||
<field name="name">Auto-email confirmed purchase orders</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<!-- EDI related Email Templates menu -->
|
||||
<record model="ir.actions.act_window" id="action_email_templates">
|
||||
|
@ -27,9 +29,11 @@
|
|||
so users can freely customize/delete them -->
|
||||
<data noupdate="1">
|
||||
<!-- bind the mailing server action to purchase.order confirmed activity -->
|
||||
<!--
|
||||
<record id="purchase.act_confirmed" model="workflow.activity">
|
||||
<field name="action_id" ref="ir_actions_server_edi_purchase"/>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_purchase" model="email.template">
|
||||
|
@ -44,7 +48,7 @@
|
|||
|
||||
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
||||
|
||||
<p>Here is a purchase order confirmation from ${object.company_id.name}: </p>
|
||||
<p>Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} from ${object.company_id.name}: </p>
|
||||
|
||||
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
|
||||
<strong>REFERENCES</strong><br />
|
||||
|
@ -61,7 +65,7 @@
|
|||
</p>
|
||||
|
||||
<p>
|
||||
You can view the order confirmation document and download it using the following link:
|
||||
You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} document and download it using the following link:
|
||||
</p>
|
||||
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
|
||||
href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
|
||||
|
@ -107,7 +111,7 @@
|
|||
<field name="body_text"><![CDATA[
|
||||
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
|
||||
|
||||
Here is a purchase order confirmation from ${object.company_id.name}:
|
||||
Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} from ${object.company_id.name}:
|
||||
| Order number: *${object.name}*
|
||||
| Order total: *${object.amount_total} ${object.pricelist_id.currency_id.name}*
|
||||
| Order date: ${object.date_order}
|
||||
|
@ -119,7 +123,7 @@ Here is a purchase order confirmation from ${object.company_id.name}:
|
|||
% endif
|
||||
| Your contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
|
||||
|
||||
You can view the order confirmation and download it using the following link:
|
||||
You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} and download it using the following link:
|
||||
${ctx.get('edi_web_url_view') or 'n/a'}
|
||||
|
||||
If you have any question, do not hesitate to contact us.
|
||||
|
@ -151,4 +155,4 @@ ${object.company_id.website or ''}
|
|||
]]></field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
|
@ -142,14 +142,15 @@ class purchase_order(osv.osv):
|
|||
return res
|
||||
|
||||
STATE_SELECTION = [
|
||||
('draft', 'Request for Quotation'),
|
||||
('cancel', 'Cancelled'),
|
||||
('draft', 'Draft PO'),
|
||||
('wait', 'Waiting'),
|
||||
('sent', 'RFQ Sent'),
|
||||
('confirmed', 'Waiting Approval'),
|
||||
('approved', 'Approved'),
|
||||
('approved', 'Purchase Order'),
|
||||
('except_picking', 'Shipping Exception'),
|
||||
('except_invoice', 'Invoice Exception'),
|
||||
('done', 'Done'),
|
||||
('cancel', 'Cancelled')
|
||||
]
|
||||
|
||||
_columns = {
|
||||
|
@ -177,7 +178,7 @@ class purchase_order(osv.osv):
|
|||
'picking_ids': fields.one2many('stock.picking.in', 'purchase_id', 'Picking List', readonly=True, help="This is the list of incomming shipments that have been generated for this purchase order."),
|
||||
'shipped':fields.boolean('Received', readonly=True, select=True, help="It indicates that a picking has been done"),
|
||||
'shipped_rate': fields.function(_shipped_rate, string='Received', type='float'),
|
||||
'invoiced': fields.function(_invoiced, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"),
|
||||
'invoiced': fields.function(_invoiced, string='Invoice Received', type='boolean', help="It indicates that an invoice has been paid"),
|
||||
'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'),
|
||||
'invoice_method': fields.selection([('manual','Based on Purchase Order lines'),('order','Based on generated draft invoice'),('picking','Bases on incoming shipments')], 'Invoicing Control', required=True,
|
||||
help="Based on Purchase Order lines: place individual lines in 'Invoice Control > Based on P.O. lines' from where you can selectively create an invoice.\n" \
|
||||
|
@ -277,10 +278,90 @@ class purchase_order(osv.osv):
|
|||
fiscal_position = supplier.property_account_position and supplier.property_account_position.id or False
|
||||
return {'value':{'pricelist_id': pricelist, 'fiscal_position': fiscal_position}}
|
||||
|
||||
def view_invoice(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function returns an action that display existing invoices of given sale order ids. It can either be a in a list or in a form view, if there is only one invoice to show.
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
wizard_obj = self.pool.get('purchase.order.line_invoice')
|
||||
#compute the number of invoices to display
|
||||
inv_ids = []
|
||||
for po in self.browse(cr, uid, ids, context=context):
|
||||
if po.invoice_method == 'manual':
|
||||
if not po.invoice_ids:
|
||||
context.update({'active_ids' : [line.id for line in po.order_line]})
|
||||
wizard_obj.makeInvoices(cr, uid, [], context=context)
|
||||
|
||||
for po in self.browse(cr, uid, ids, context=context):
|
||||
inv_ids+= [invoice.id for invoice in po.invoice_ids]
|
||||
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_supplier_form')
|
||||
res_id = res and res[1] or False
|
||||
|
||||
return {
|
||||
'name': _('Supplier Invoices'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'view_id': [res_id],
|
||||
'res_model': 'account.invoice',
|
||||
'context': "{'type':'in_invoice', 'journal_type': 'purchase'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
'res_id': inv_ids and inv_ids[0] or False,
|
||||
}
|
||||
|
||||
def view_picking(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function returns an action that display existing pîcking orders of given purchase order ids.
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
pick_ids = []
|
||||
for po in self.browse(cr, uid, ids, context=context):
|
||||
pick_ids += [picking.id for picking in po.picking_ids]
|
||||
|
||||
res = mod_obj.get_object_reference(cr, uid, 'stock', 'view_picking_in_form')
|
||||
res_id = res and res[1] or False
|
||||
|
||||
return {
|
||||
'name': _('Receptions'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'view_id': [res_id],
|
||||
'res_model': 'stock.picking',
|
||||
'context': "{'contact_display': 'partner'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
'res_id': pick_ids and pick_ids[0] or False,
|
||||
}
|
||||
|
||||
def wkf_approve_order(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': fields.date.context_today(self,cr,uid,context=context)})
|
||||
return True
|
||||
|
||||
def wkf_send_rfq(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function opens a window to compose an email, with the edi purchase template message loaded by default
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
template = mod_obj.get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase')
|
||||
template_id = template and template[1] or False
|
||||
res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')
|
||||
res_id = res and res[1] or False
|
||||
ctx = dict(context, active_model='purchase.order', active_id=ids[0])
|
||||
ctx.update({'mail.compose.template_id': template_id})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'mail.compose.message',
|
||||
'views': [(res_id,'form')],
|
||||
'view_id': res_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': ctx,
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
#TODO: implement messages system
|
||||
def wkf_confirm_order(self, cr, uid, ids, context=None):
|
||||
todo = []
|
||||
|
@ -445,6 +526,8 @@ class purchase_order(osv.osv):
|
|||
'partner_id': order.dest_address_id.id or order.partner_id.id,
|
||||
'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
|
||||
'type': 'in',
|
||||
'partner_id': order.dest_address_id.id or order.partner_id.id,
|
||||
'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
|
||||
'purchase_id': order.id,
|
||||
'company_id': order.company_id.id,
|
||||
'move_lines' : [],
|
||||
|
@ -996,4 +1079,16 @@ class procurement_order(osv.osv):
|
|||
return res
|
||||
|
||||
procurement_order()
|
||||
|
||||
class mail_message(osv.osv):
|
||||
_name = 'mail.message'
|
||||
_inherit = 'mail.message'
|
||||
|
||||
def _postprocess_sent_message(self, cr, uid, message, context=None):
|
||||
if message.model == 'purchase.order':
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'purchase.order', message.res_id, 'send_rfq', cr)
|
||||
return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context)
|
||||
|
||||
mail_message()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -132,15 +132,18 @@
|
|||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
<button name="purchase_confirm" states="draft,sent" string="Confirm Order" class="oe_form_button_hi"/>
|
||||
<button name="wkf_send_rfq" states="draft" string="Send RFQ" type="object" context="{'send_rfq':True}"/>
|
||||
<button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object"/>
|
||||
<button name="action_cancel" states="except_picking,except_invoice,wait" string="Cancel" type="object" />
|
||||
<button name="picking_ok" states="except_picking" string="Manually Corrected"/>
|
||||
<button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
|
||||
<button name="purchase_confirm" states="draft" string="Confirm Purchase"/>
|
||||
<button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase"/>
|
||||
<button name="purchase_approve" states="confirmed" string="Approved"/>
|
||||
<button name="%(report_purchase_order)d" string="Print" states="approved" type="action"/>
|
||||
<button name="action_cancel" states="approved,except_picking,except_invoice,wait" string="Cancel" type="object"/>
|
||||
<button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel"/>
|
||||
<button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" class="oe_form_button_hi"/>
|
||||
<button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_form_button_hi"/>
|
||||
<button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}"/>
|
||||
<button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}"/>
|
||||
<button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object"/>
|
||||
<button name="purchase_cancel" states="draft,confirmed,wait_auth,sent" string="Cancel"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue","wait":"blue"}' readonly="1"/>
|
||||
</div>
|
||||
|
@ -225,9 +228,8 @@
|
|||
<filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase order which are in draft state"/>
|
||||
<filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" help="Approved purchase order"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
|
||||
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Reference"/>
|
||||
<field name="partner_id"/>
|
||||
|
@ -257,13 +259,10 @@
|
|||
<search string="Search Purchase Order">
|
||||
<group>
|
||||
<filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
|
||||
<filter icon="terp-gtk-jump-to-ltr" name="to_approve" string="To Approve" domain="[('state','in',('draft','wait','confirmed'))]" help="Purchase orders which are not approved yet."/>
|
||||
<filter icon="terp-check" name="approved" string="Approved" domain="[('state','=','approved')]" help="Approved purchase orders"/>
|
||||
<filter icon="terp-accessories-archiver+" string="Done" domain="[('state','=','done')]" help="Purchase orders which are in done state."/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
|
||||
<filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
|
||||
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Reference"/>
|
||||
<field name="partner_id"/>
|
||||
|
@ -308,12 +307,12 @@
|
|||
</record>
|
||||
|
||||
<record id="purchase_rfq" model="ir.actions.act_window">
|
||||
<field name="name">Requests for Quotation</field>
|
||||
<field name="name">Quotations</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="context">{'search_default_draft': 1}</field>
|
||||
<field name="view_mode">tree,form,graph,calendar</field>
|
||||
<field name="search_view_id" ref="view_request_for_quotation_filter"/>
|
||||
<field name="search_view_id" ref="view_purchase_order_filter"/>
|
||||
<field name="help">You can create a request for quotation when you want to buy products to a supplier but the purchase is not confirmed yet. Use also this menu to review requests for quotation created automatically based on your logistic rules (minimum stock, MTO, etc). You can convert the request for quotation into a purchase order once the order is confirmed. If you use the extended interface (from user's preferences), you can select the way to control your supplier invoices: based on the order, based on the receptions or manual encoding.</field>
|
||||
</record>
|
||||
<menuitem action="purchase_rfq" id="menu_purchase_rfq"
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
<field name="flow_start">True</field>
|
||||
<field name="name">draft</field>
|
||||
</record>
|
||||
<record id="act_sent" model="workflow.activity">
|
||||
<field name="wkf_id" ref="purchase_order"/>
|
||||
<field name="name">sent</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">write({'state':'sent'})</field>
|
||||
</record>
|
||||
<record id="act_confirmed" model="workflow.activity">
|
||||
<field name="wkf_id" ref="purchase_order"/>
|
||||
<field name="name">confirmed</field>
|
||||
|
@ -90,6 +96,22 @@
|
|||
<field name="act_to" ref="act_confirmed"/>
|
||||
<field name="signal">purchase_confirm</field>
|
||||
</record>
|
||||
<record id="trans_draft_sent" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_sent"/>
|
||||
<field name="signal">send_rfq</field>
|
||||
</record>
|
||||
<record id="trans_sent_confirmed" model="workflow.transition">
|
||||
<field name="act_from" ref="act_sent"/>
|
||||
<field name="act_to" ref="act_confirmed"/>
|
||||
<field name="signal">purchase_confirm</field>
|
||||
</record>
|
||||
<record id="trans_sent_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_sent"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">purchase_cancel</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_confirmed_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirmed"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
|
|
|
@ -38,6 +38,7 @@ that exceeds minimum amount set by configuration wizard.
|
|||
'update_xml': [
|
||||
'purchase_double_validation_workflow.xml',
|
||||
'purchase_double_validation_installer.xml',
|
||||
'purchase_double_validation_view.xml',
|
||||
'board_purchase_view.xml'
|
||||
],
|
||||
'test': [
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="purchase_order_search_inherit">
|
||||
<field name="name">purchase.order.list.select.inherit</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='draft']" position="after">
|
||||
<filter icon="terp-gtk-jump-to-ltr" name="to_approve" string="To Approve" domain="[('state','in',('wait','confirmed'))]" help="Purchase orders which are not approved yet."/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -21,22 +21,8 @@
|
|||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/search/group/filter[@name='not_invoiced']" position="after">
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" help="Purchase Orders with requisition"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="request_for_quotation_inherit">
|
||||
<field name="name">request.for.quotation.select.inherit</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_request_for_quotation_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/search/group/filter[@name='not_invoiced']" position="after">
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" help="Purchase Orders with requisition"/>
|
||||
<xpath expr="//filter[@name='approved']" position="after">
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" help="Purchase Orders with requisition"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_header_img" id="menu_header_img" parent="base.menu_res_company_global" sequence="14"/>
|
||||
<menuitem action="action_header_img" id="menu_header_img" parent="base.menu_custom" sequence="14"/>
|
||||
|
||||
<record id="action_header_webkit" model="ir.actions.act_window">
|
||||
<field name="name">Webkit Headers/Footers</field>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_header_webkit" id="menu_header_webkit" parent="base.menu_res_company_global" sequence="14"/>
|
||||
<menuitem action="action_header_webkit" id="menu_header_webkit" parent="base.menu_custom" sequence="14"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -24,6 +24,7 @@ from dateutil.relativedelta import relativedelta
|
|||
|
||||
from osv import fields, osv, orm
|
||||
from edi import EDIMixin
|
||||
from edi.models import edi
|
||||
from tools import DEFAULT_SERVER_DATE_FORMAT
|
||||
|
||||
SALE_ORDER_LINE_EDI_STRUCT = {
|
||||
|
@ -59,11 +60,21 @@ SALE_ORDER_EDI_STRUCT = {
|
|||
'payment_term': True,
|
||||
'order_policy': True,
|
||||
'user_id': True,
|
||||
'state': True,
|
||||
}
|
||||
|
||||
class sale_order(osv.osv, EDIMixin):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
def action_quotation_send(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
sale_objs = self.browse(cr, uid, ids, context=context)
|
||||
edi_token = self.pool.get('edi.document').export_edi(cr, uid, sale_objs, context = context)[0]
|
||||
web_root_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
|
||||
ctx = dict(context, edi_web_url_view=edi.EDI_VIEW_WEB_URL % (web_root_url, cr.dbname, edi_token))
|
||||
return super(sale_order, self).action_quotation_send(cr, uid, ids, context=ctx)
|
||||
|
||||
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
|
||||
"""Exports a Sale order"""
|
||||
edi_struct = dict(edi_struct or SALE_ORDER_EDI_STRUCT)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
||||
|
||||
<p>Here is your order confirmation for ${object.partner_id.name}: </p>
|
||||
<p>Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from {$object.company_id.name}: </p>
|
||||
|
||||
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
|
||||
<strong>REFERENCES</strong><br />
|
||||
|
@ -64,12 +64,12 @@
|
|||
</p>
|
||||
|
||||
<p>
|
||||
You can view the order confirmation document, download it and pay online using the following link:
|
||||
You can view the ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} document, download it and pay online using the following link:
|
||||
</p>
|
||||
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
|
||||
href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
|
||||
|
||||
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account:
|
||||
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state not in ('draft', 'sent'):
|
||||
<%
|
||||
comp_name = quote(object.company_id.name)
|
||||
order_name = quote(object.name)
|
||||
|
@ -129,7 +129,7 @@
|
|||
<field name="body_text"><![CDATA[
|
||||
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
|
||||
|
||||
Here is your order confirmation for ${object.partner_id.name}:
|
||||
Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:
|
||||
| Order number: *${object.name}*
|
||||
| Order total: *${object.amount_total} ${object.pricelist_id.currency_id.name}*
|
||||
| Order date: ${object.date_order}
|
||||
|
@ -141,10 +141,10 @@ Here is your order confirmation for ${object.partner_id.name}:
|
|||
% endif
|
||||
| Your contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
|
||||
|
||||
You can view the order confirmation, download it and even pay online using the following link:
|
||||
You can view the ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'}, download it and even pay online using the following link:
|
||||
${ctx.get('edi_web_url_view') or 'n/a'}
|
||||
|
||||
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account:
|
||||
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state not in ('draft', 'sent'):
|
||||
<%
|
||||
comp_name = quote(object.company_id.name)
|
||||
order_name = quote(object.name)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -198,45 +198,46 @@ class sale_order(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'name': fields.char('Order Reference', size=64, required=True,
|
||||
readonly=True, states={'draft': [('readonly', False)]}, select=True),
|
||||
'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True),
|
||||
'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
|
||||
'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this sales order request."),
|
||||
'client_order_ref': fields.char('Customer Reference', size=64),
|
||||
'state': fields.selection([
|
||||
('draft', 'Quotation'),
|
||||
('draft', 'Draft Quotation'),
|
||||
('sent', 'Quotation Sent'),
|
||||
('cancel', 'Cancelled'),
|
||||
('waiting_date', 'Waiting Schedule'),
|
||||
('manual', 'To Invoice'),
|
||||
('progress', 'In Progress'),
|
||||
('progress', 'Sale Order'),
|
||||
('manual', 'Sale to Invoice'),
|
||||
('shipping_except', 'Shipping Exception'),
|
||||
('invoice_except', 'Invoice Exception'),
|
||||
('done', 'Done'),
|
||||
], '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 order date.", select=True),
|
||||
'date_order': fields.date('Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)]}),
|
||||
'date_order': fields.date('Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
|
||||
'create_date': fields.datetime('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', 'Salesperson', 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', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sales order."),
|
||||
'partner_shipping_id': fields.many2one('res.partner', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."),
|
||||
'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True),
|
||||
'partner_invoice_id': fields.many2one('res.partner', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order."),
|
||||
'partner_shipping_id': fields.many2one('res.partner', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Shipping address for current sales order."),
|
||||
|
||||
'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."),
|
||||
'picking_policy': fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')],
|
||||
'Shipping Policy', required=True, readonly=True, states={'draft': [('readonly', False)]},
|
||||
'Shipping Policy', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
|
||||
help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""),
|
||||
'order_policy': fields.selection([
|
||||
('manual', 'On Demand'),
|
||||
('picking', 'On Delivery Order'),
|
||||
('prepaid', 'Before Delivery'),
|
||||
], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)]},
|
||||
], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
|
||||
help="""This field controls how invoice and delivery operations are synchronized.
|
||||
- With 'On Demand', the invoice is created manually when needed.
|
||||
- With 'On Delivery Order', a draft invoice is generated after all pickings have been processed.
|
||||
- With 'Before Delivery', a draft invoice is created, and it must be paid before delivery."""),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist for current sales order."),
|
||||
'project_id': fields.many2one('account.analytic.account', 'Contract/Analytic Account', readonly=True, states={'draft': [('readonly', False)]}, help="The analytic account related to a sales order."),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order."),
|
||||
'project_id': fields.many2one('account.analytic.account', 'Contract/Analytic Account', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."),
|
||||
|
||||
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
|
||||
'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', readonly=True, help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."),
|
||||
'picking_ids': fields.one2many('stock.picking.out', 'sale_id', 'Related Picking', readonly=True, help="This is a list of delivery orders that has been generated for this sales order."),
|
||||
'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sales order has been delivered. This field is updated only after the scheduler(s) have been launched."),
|
||||
|
@ -467,6 +468,20 @@ class sale_order(osv.osv):
|
|||
inv_obj.button_compute(cr, uid, [inv_id])
|
||||
return inv_id
|
||||
|
||||
def print_quotation(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function prints the sale order and mark it as sent, so that we can see more easily the next step of the workflow
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'sale.order', ids[0], 'quotation_sent', cr)
|
||||
datas = {
|
||||
'model': 'sale.order',
|
||||
'ids': ids,
|
||||
'form': self.read(cr, uid, ids[0], context=context),
|
||||
}
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'sale.order', 'datas': datas, 'nodestroy': True}
|
||||
|
||||
def manual_invoice(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
@ -498,6 +513,75 @@ class sale_order(osv.osv):
|
|||
'res_id': inv_ids and inv_ids[0] or False,
|
||||
}
|
||||
|
||||
def action_view_invoice(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function returns an action that display existing invoices of given sale order ids. It can either be a in a list or in a form view, if there is only one invoice to show.
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
result = {
|
||||
'name': _('Cutomer Invoice'),
|
||||
'view_type': 'form',
|
||||
'res_model': 'account.invoice',
|
||||
'context': "{'type':'out_invoice', 'journal_type': 'sale'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
}
|
||||
#compute the number of invoices to display
|
||||
inv_ids = []
|
||||
for so in self.browse(cr, uid, ids, context=context):
|
||||
inv_ids += [invoice.id for invoice in so.invoice_ids]
|
||||
#choose the view_mode accordingly
|
||||
if len(inv_ids)>1:
|
||||
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_tree')
|
||||
result.update({
|
||||
'view_mode': 'tree,form',
|
||||
'res_id': inv_ids or False
|
||||
})
|
||||
else:
|
||||
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
|
||||
result.update({
|
||||
'view_mode': 'form',
|
||||
'res_id': inv_ids and inv_ids[0] or False,
|
||||
})
|
||||
result.update(view_id = res and res[1] or False)
|
||||
return result
|
||||
|
||||
|
||||
def action_view_delivery(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function returns an action that display existing delivery orders of given sale order ids. It can either be a in a list or in a form view, if there is only one delivery order to show.
|
||||
'''
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
result = {
|
||||
'name': _('Delivery Order'),
|
||||
'view_type': 'form',
|
||||
'res_model': 'stock.picking',
|
||||
'context': "{'type':'out'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'current',
|
||||
}
|
||||
#compute the number of delivery orders to display
|
||||
pick_ids = []
|
||||
for so in self.browse(cr, uid, ids, context=context):
|
||||
pick_ids += [picking.id for picking in so.picking_ids]
|
||||
#choose the view_mode accordingly
|
||||
if len(pick_ids) > 1:
|
||||
res = mod_obj.get_object_reference(cr, uid, 'stock', 'view_picking_out_tree')
|
||||
result.update({
|
||||
'view_mode': 'tree,form',
|
||||
'res_id': pick_ids or False
|
||||
})
|
||||
else:
|
||||
res = mod_obj.get_object_reference(cr, uid, 'stock', 'view_picking_out_form')
|
||||
result.update({
|
||||
'view_mode': 'form',
|
||||
'res_id': pick_ids and pick_ids[0] or False,
|
||||
})
|
||||
result.update(view_id = res and res[1] or False)
|
||||
return result
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
|
||||
res = False
|
||||
invoices = {}
|
||||
|
@ -655,6 +739,30 @@ class sale_order(osv.osv):
|
|||
self.confirm_send_note(cr, uid, ids, context)
|
||||
return True
|
||||
|
||||
def action_quotation_send(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function opens a window to compose an email, with the edi sale template message loaded by default
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
template = mod_obj.get_object_reference(cr, uid, 'sale', 'email_template_edi_sale')
|
||||
template_id = template and template[1] or False
|
||||
res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')
|
||||
res_id = res and res[1] or False
|
||||
ctx = dict(context, active_model='sale.order', active_id=ids[0])
|
||||
ctx.update({'mail.compose.template_id': template_id})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'mail.compose.message',
|
||||
'views': [(res_id,'form')],
|
||||
'view_id': res_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': ctx,
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
def procurement_lines_get(self, cr, uid, ids, *args):
|
||||
res = []
|
||||
for order in self.browse(cr, uid, ids, context={}):
|
||||
|
@ -1380,4 +1488,15 @@ class sale_order_line(osv.osv):
|
|||
|
||||
sale_order_line()
|
||||
|
||||
class mail_message(osv.osv):
|
||||
_inherit = 'mail.message'
|
||||
|
||||
def _postprocess_sent_message(self, cr, uid, message, context=None):
|
||||
if message.model == 'sale.order':
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'sale.order', message.res_id, 'quotation_sent', cr)
|
||||
return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context)
|
||||
|
||||
mail_message()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -97,23 +97,29 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button name="order_confirm" states="draft" string="Confirm Order"/>
|
||||
<button name="manual_invoice" states="manual" string="Create Final Invoice" type="object"/>
|
||||
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
|
||||
<button name="invoice_corrected" states="invoice_except" string="Ignore Exception"/>
|
||||
<button name="ship_recreate" states="shipping_except" string="Recreate Packing"/>
|
||||
<button name="ship_corrected" states="shipping_except" string="Ignore Exception"/>
|
||||
<button name="%(report_sale_order)d" string="Print Order" type="action" states="waiting_date,manual,progress,done,shipping_except,invoice_except"/>
|
||||
<button name="ship_cancel" states="shipping_except" string="Cancel Order"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
<button name="invoice_cancel" states="invoice_except" string="Cancel Order"/>
|
||||
<button name="%(report_sale_order)d" string="Print Quotation" type="action" states="draft"/>
|
||||
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" states="draft,manual"/>
|
||||
<button name="action_cancel" states="manual,progress" string="Cancel Order" type="object"/>
|
||||
<button name="cancel" states="draft" string="Cancel Order"/>
|
||||
<div class="oe_form_topbar">
|
||||
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
|
||||
<button name="invoice_corrected" states="invoice_except" string="Ignore Exception"/>
|
||||
<button name="ship_recreate" states="shipping_except" string="Recreate Delivery Order"/>
|
||||
<button name="ship_corrected" states="shipping_except" string="Ignore Exception"/>
|
||||
<button name="action_quotation_send" string="Send by Mail" type="object" states="draft" class="oe_form_button_hi"/>
|
||||
<button name="action_quotation_send" string="Send by Mail" type="object" states="sent"/>
|
||||
<button name="manual_invoice" states="manual" string="Create Final Invoice" type="object"/>
|
||||
<button name="print_quotation" string="Send by Post" type="object" states="draft" class="oe_form_button_hi"/>
|
||||
<button name="print_quotation" string="Send by Post" type="object" states="sent"/>
|
||||
<button name="order_confirm" states="draft" string="Confirm"/>
|
||||
<button name="order_confirm" states="sent" string="Confirm" class="oe_form_button_hi"/>
|
||||
<button name="action_view_invoice" string="Open Invoice" type="object"
|
||||
attrs="{'invisible': ['|','|',('state', '!=','progress'), ('invoiced', '=', True),('order_policy','=','picking')]}"/>
|
||||
<button name="action_view_delivery" string="Open Delivery Order" type="object"
|
||||
attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
|
||||
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" states="manual"/>
|
||||
<button name="cancel" states="draft,sent" string="Cancel"/>
|
||||
<button name="action_cancel" states="manual,progress" string="Cancel" type="object"/>
|
||||
<button name="ship_cancel" states="shipping_except" string="Cancel"/>
|
||||
<button name="invoice_cancel" states="invoice_except" string="Cancel"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,progress,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
|
||||
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,sent,progress,invoiced,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
|
||||
</div>
|
||||
<div class="oe_clear"/>
|
||||
</div>
|
||||
|
@ -208,8 +214,9 @@
|
|||
<field name="price_subtotal" groups="base.group_sale_notes_subtotal"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<div class="oe_form_subtotal_footer" colspan="4">
|
||||
<group colspan="2" col="4" name="bellow_the_lines_hook">
|
||||
</group>
|
||||
<div class="oe_form_subtotal_footer" colspan="2">
|
||||
<div>
|
||||
<field name="amount_untaxed" sum="Untaxed amount"/>
|
||||
</div>
|
||||
|
@ -281,7 +288,7 @@
|
|||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Sales Order">
|
||||
<filter icon="terp-document-new" string="Quotations" name="draft" domain="[('state','=','draft')]" help="Sales Order that haven't yet been confirmed"/>
|
||||
<filter icon="terp-document-new" string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
|
||||
<filter icon="terp-check" string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
<field name="flow_start">True</field>
|
||||
<field name="name">draft</field>
|
||||
</record>
|
||||
<record id="act_sent" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_sale"/>
|
||||
<field name="name">sent</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">write({'state':'sent'})</field>
|
||||
</record>
|
||||
<record id="act_router" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_sale"/>
|
||||
<field name="name">router</field>
|
||||
|
@ -123,6 +129,24 @@
|
|||
<field name="signal">order_confirm</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_draft_sent" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_sent"/>
|
||||
<field name="signal">quotation_sent</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_sent_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_sent"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_sent_router" model="workflow.transition">
|
||||
<field name="act_from" ref="act_sent"/>
|
||||
<field name="act_to" ref="act_router"/>
|
||||
<field name="signal">order_confirm</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_draft_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
|
|
|
@ -735,9 +735,9 @@ class stock_picking(osv.osv):
|
|||
""" Changes state of picking to available if all moves are confirmed.
|
||||
@return: True
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if pick.state == 'draft':
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_confirm', cr)
|
||||
move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed']
|
||||
if not move_ids:
|
||||
|
|
|
@ -912,14 +912,13 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and min_date < current_date" string="Delivery Orders">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="origin"/>
|
||||
<field name="date"/>
|
||||
<field name="min_date"/>
|
||||
<field name="backorder_id"/>
|
||||
<field name="stock_journal_id"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="stock_journal_id" widget="selection"/>
|
||||
<field name="state"/>
|
||||
<button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -1032,6 +1031,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';grey:state == 'done';red:state not in ('cancel', 'done') and date < current_date" string="Picking list">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="backorder_id"/>
|
||||
<field name="origin"/>
|
||||
<field name="date"/>
|
||||
|
|
Loading…
Reference in New Issue