[MERGE] Merge with dev-addons3 branch
bzr revid: psi@tinyerp.co.in-20100622084432-1o23zvx7fw440tyk
This commit is contained in:
commit
7499f9039c
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Financial Management" sequence="1"/>
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="13"/>
|
||||
<menuitem id="menu_finance_receivables" name="Receivables" parent="menu_finance" sequence="2"/>
|
||||
<menuitem id="menu_finance_payables" name="Payables" parent="menu_finance" sequence="3"/>
|
||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"/>
|
||||
|
@ -26,7 +26,6 @@
|
|||
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting"/>
|
||||
<menuitem id="menu_configuration_misc" name="Miscelleanous" parent="menu_finance_configuration"/>
|
||||
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Financial Management" sequence="5"/>
|
||||
<!-- <menuitem id="menu_finance_configuration1" name="Configuration" parent="menu_finance" sequence="80"/>-->
|
||||
<!-- <menuitem id="base.menu_action_currency_form" parent="menu_finance_configuration" sequence="20"/>-->
|
||||
<!-- <menuitem id="menu_finance_accounting1" name="Financial Accounting" parent="menu_finance_configuration" sequence="80"/>-->
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
</form>
|
||||
</field>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state" select="1" readonly="1"/>
|
||||
<group col="2" colspan="2">
|
||||
<group>
|
||||
<field name="state" select="1" readonly="1"/>
|
||||
<button name="create_period" states="draft" string="Create Monthly Periods" type="object" icon="gtk-dnd"/>
|
||||
<button name="create_period3" states="draft" string="Create 3 Months Periods" type="object" icon="gtk-dnd"/>
|
||||
</group>
|
||||
|
@ -202,14 +202,15 @@
|
|||
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Purchase Accounts" domain="[('type','=','purchase')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="user_type" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="user_type"/>
|
||||
<field name="type"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Parent Account" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="User Type" icon="terp-folder-blue" domain="" context="{'group_by':'user_type'}"/>
|
||||
<filter string="Internal Type" icon="terp-folder-yellow" domain="" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
|
@ -236,6 +237,8 @@
|
|||
<tree string="Chart of accounts" toolbar="1" colors="blue:type in ('view');black:type not in ('view')">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="user_type" invisible="1"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="balance"/>
|
||||
|
@ -313,6 +316,8 @@
|
|||
<tree string="Account Journal">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -696,7 +701,8 @@
|
|||
<field name="sum"/>
|
||||
<field name="sum_period"/>
|
||||
<newline/>
|
||||
<field colspan="4" name="info"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field colspan="4" name="info" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -724,6 +730,7 @@
|
|||
<field name="name"/>
|
||||
<field name="price_include" groups="base.group_extended"/>
|
||||
<field name="description"/>
|
||||
<field name="tax_group" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -742,7 +749,7 @@
|
|||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Tax Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
|
||||
<filter string="Tax Group" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'tax_group'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -1796,6 +1803,8 @@
|
|||
<tree string="Account Template">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="user_type" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -1896,6 +1905,10 @@
|
|||
<field name="account_root_id"/>
|
||||
<field name="tax_code_root_id"/>
|
||||
<field name="bank_account_view_id"/>
|
||||
<field name="property_account_receivable" invisible="1"/>
|
||||
<field name="property_account_payable" invisible="1"/>
|
||||
<field name="property_account_expense_categ" invisible="1"/>
|
||||
<field name="property_account_income_categ" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -2015,6 +2028,7 @@
|
|||
<tree string="Account Tax Code Template" toolbar="1">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -2026,9 +2040,9 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Search tax template">
|
||||
<group>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
<separator string="Purchase Properties" colspan="2"/>
|
||||
<field name="property_account_income" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="property_account_expense" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="supplier_taxes_id"/>
|
||||
<field name="taxes_id"/>
|
||||
<field name="supplier_taxes_id"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
<field name="balance"/>
|
||||
<field name="quantity"/>
|
||||
<field name="quantity_max"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -293,7 +297,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_analytic_journal_search" model="ir.ui.view">
|
||||
<field name="name">account.analytic.journal.search</field>
|
||||
<field name="model">account.analytic.journal</field>
|
||||
|
@ -306,7 +310,7 @@
|
|||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_analytic_journal_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.journal.form</field>
|
||||
<field name="model">account.analytic.journal</field>
|
||||
|
@ -350,7 +354,7 @@
|
|||
</record> -->
|
||||
<!-- <menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_bank_and_cash"/>-->
|
||||
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
|
||||
<field name="name">Checks Register</field>
|
||||
<field name="name">Check Registers</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -310,14 +310,6 @@
|
|||
auto="False"
|
||||
menu="False"/>-->
|
||||
|
||||
<!--Menu for project management-->
|
||||
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
|
||||
<menuitem id="base.menu_pm_invoicing" name="Billing" parent="base.menu_main_pm" sequence="7"/>
|
||||
<menuitem id="menu_pm_budget" name="Budgets" parent="base.menu_pm_invoicing"/>
|
||||
<menuitem action="open_budget_post_form" id="menu_pm_budget_post_form" parent="menu_pm_budget"/>
|
||||
<menuitem parent="menu_pm_budget"
|
||||
id="menu_act_pm_crossovered_budget_view"
|
||||
action="act_crossovered_budget_view" />
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -111,10 +111,8 @@
|
|||
|
||||
<!--======================================== MENUS ========================================-->
|
||||
<menuitem name="MailBox" id="menu_email_template_mailbox_all_main2" parent="menu_email_template" />
|
||||
<menuitem name="Personal" id="menu_email_template_personal" parent="menu_email_template_mailbox_all_main2" />
|
||||
<menuitem name="Mails" id="menu_email_template_personal_mails" parent="menu_email_template_personal" action="action_email_template_mailbox"/>
|
||||
<menuitem name="Company" id="menu_email_template_company" parent="menu_email_template_mailbox_all_main2" />
|
||||
<menuitem name="Mails" id="menu_email_template_company_mails" parent="menu_email_template_company" action="action_email_template_mailbox"/>
|
||||
<menuitem name="Personal Mails" id="menu_email_template_personal_mails" parent="menu_email_template_mailbox_all_main2" action="action_email_template_mailbox"/>
|
||||
<menuitem name="Company Mails" id="menu_email_template_company_mails" parent="menu_email_template_mailbox_all_main2" action="action_email_template_mailbox"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -33,5 +33,4 @@ class company(osv.osv):
|
|||
}
|
||||
company()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -20,10 +20,11 @@
|
|||
##############################################################################
|
||||
|
||||
import time
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
||||
|
@ -41,8 +42,8 @@ class sale_shop(osv.osv):
|
|||
'project_id': fields.many2one('account.analytic.account', 'Analytic Account'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
}
|
||||
sale_shop()
|
||||
|
||||
sale_shop()
|
||||
|
||||
def _incoterm_get(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
|
@ -77,11 +78,11 @@ class sale_order(osv.osv):
|
|||
return val
|
||||
|
||||
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
if context is None:
|
||||
context = {}
|
||||
res = {}
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
for order in self.browse(cr, uid, ids, context):
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
res[order.id] = {
|
||||
'amount_untaxed': 0.0,
|
||||
'amount_tax': 0.0,
|
||||
|
@ -281,13 +282,13 @@ class sale_order(osv.osv):
|
|||
}
|
||||
_defaults = {
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
|
||||
'picking_policy': lambda *a: 'direct',
|
||||
'date_order': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'order_policy': lambda *a: 'manual',
|
||||
'state': lambda *a: 'draft',
|
||||
'picking_policy': 'direct',
|
||||
'date_order': time.strftime('%Y-%m-%d'),
|
||||
'order_policy': 'manual',
|
||||
'state': 'draft',
|
||||
'user_id': lambda obj, cr, uid, context: uid,
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'),
|
||||
'invoice_quantity': lambda *a: 'order',
|
||||
'invoice_quantity': 'order',
|
||||
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
|
||||
'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'],
|
||||
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
|
||||
|
@ -333,7 +334,7 @@ class sale_order(osv.osv):
|
|||
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sale order ') + " '" + name + "' "+ _("is in draft state")
|
||||
self.log(cr, uid, id, message)
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
|
@ -408,8 +409,16 @@ class sale_order(osv.osv):
|
|||
return {}
|
||||
|
||||
def _make_invoice(self, cr, uid, order, lines, context=None):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
|
||||
if not journal_ids:
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
|
||||
a = order.partner_id.property_account_receivable.id
|
||||
if order.payment_term:
|
||||
pay_term = order.payment_term.id
|
||||
|
@ -420,11 +429,6 @@ class sale_order(osv.osv):
|
|||
for preline in preinv.invoice_line:
|
||||
inv_line_id = self.pool.get('account.invoice.line').copy(cr, uid, preline.id, {'invoice_id': False, 'price_unit': -preline.price_unit})
|
||||
lines.append(inv_line_id)
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
|
||||
if not journal_ids:
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
|
||||
|
||||
inv = {
|
||||
'name': order.client_order_ref or order.name,
|
||||
|
@ -445,7 +449,6 @@ class sale_order(osv.osv):
|
|||
'company_id' : order.company_id.id,
|
||||
'user_id':order.user_id and order.user_id.id or False
|
||||
}
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv.update(self._inv_get(cr, uid, order))
|
||||
inv_id = inv_obj.create(cr, uid, inv, context=context)
|
||||
data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], pay_term, time.strftime('%Y-%m-%d'))
|
||||
|
@ -454,12 +457,14 @@ class sale_order(osv.osv):
|
|||
inv_obj.button_compute(cr, uid, [inv_id])
|
||||
return inv_id
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False):
|
||||
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
|
||||
res = False
|
||||
invoices = {}
|
||||
invoice_ids = []
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
|
||||
context = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
|
||||
# last day of the last month as invoice date
|
||||
if date_inv:
|
||||
|
@ -478,7 +483,6 @@ class sale_order(osv.osv):
|
|||
for i in o.invoice_ids:
|
||||
if i.state == 'draft':
|
||||
return i.id
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
for val in invoices.values():
|
||||
if grouped:
|
||||
res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x,y: x + y, [l for o,l in val], []), context=context)
|
||||
|
@ -559,19 +563,19 @@ class sale_order(osv.osv):
|
|||
|
||||
def action_wait(self, cr, uid, ids, *args):
|
||||
product=[]
|
||||
product_obj=self.pool.get('product.product')
|
||||
product_obj = self.pool.get('product.product')
|
||||
for o in self.browse(cr, uid, ids):
|
||||
if (o.order_policy == 'manual'):
|
||||
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
|
||||
else:
|
||||
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')})
|
||||
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
|
||||
for line in o.order_line:
|
||||
for line in o.order_line:
|
||||
product.append(line.product_id.default_code)
|
||||
params = ', '.join(map(lambda x : str(x),product))
|
||||
message = _('Sale order ') + " '" + o.name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("is confirmed")
|
||||
self.log(cr, uid, id, message)
|
||||
|
||||
return True
|
||||
|
||||
def procurement_lines_get(self, cr, uid, ids, *args):
|
||||
res = []
|
||||
|
@ -773,10 +777,10 @@ sale_order()
|
|||
# - use it in report if there is a uos
|
||||
class sale_order_line(osv.osv):
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
context = context or {}
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
res = {}
|
||||
context = context or {}
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
price = line.price_unit * line.product_uom_qty * (1 - (line.discount or 0.0) / 100.0)
|
||||
taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty)
|
||||
|
@ -834,15 +838,15 @@ class sale_order_line(osv.osv):
|
|||
}
|
||||
_order = 'sequence, id'
|
||||
_defaults = {
|
||||
'discount': lambda *a: 0.0,
|
||||
'delay': lambda *a: 0.0,
|
||||
'product_uom_qty': lambda *a: 1,
|
||||
'product_uos_qty': lambda *a: 1,
|
||||
'sequence': lambda *a: 10,
|
||||
'invoiced': lambda *a: 0,
|
||||
'state': lambda *a: 'draft',
|
||||
'type': lambda *a: 'make_to_stock',
|
||||
'product_packaging': lambda *a: False
|
||||
'discount': 0.0,
|
||||
'delay': 0.0,
|
||||
'product_uom_qty': 1,
|
||||
'product_uos_qty': 1,
|
||||
'sequence': 10,
|
||||
'invoiced': 0,
|
||||
'state': 'draft',
|
||||
'type': 'make_to_stock',
|
||||
'product_packaging': False
|
||||
}
|
||||
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
|
@ -934,7 +938,7 @@ class sale_order_line(osv.osv):
|
|||
context = {}
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sale order line') + " '" + name + "' "+ _("is confirmed")
|
||||
self.log(cr, uid, id, message)
|
||||
self.log(cr, uid, id, message)
|
||||
return self.write(cr, uid, ids, {'state': 'confirmed'})
|
||||
|
||||
def button_done(self, cr, uid, ids, context=None):
|
||||
|
@ -1177,3 +1181,4 @@ class sale_config_picking_policy(osv.osv_memory):
|
|||
self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
|
||||
sale_config_picking_policy()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -27,7 +27,7 @@ class stock_move(osv.osv):
|
|||
'sale_line_id': fields.many2one('sale.order.line', 'Sale Order Line', ondelete='set null', select=True, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'sale_line_id': lambda *a:False
|
||||
'sale_line_id': False
|
||||
}
|
||||
stock_move()
|
||||
|
||||
|
@ -37,7 +37,7 @@ class stock_picking(osv.osv):
|
|||
'sale_id': fields.many2one('sale.order', 'Sale Order', ondelete='set null', select=True, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'sale_id': lambda *a: False
|
||||
'sale_id': False
|
||||
}
|
||||
|
||||
def get_currency_id(self, cursor, user, picking):
|
||||
|
@ -127,7 +127,7 @@ class stock_picking(osv.osv):
|
|||
for invoice in invoice_obj.browse(cursor, user, invoice_ids,
|
||||
context=context):
|
||||
invoices[invoice.id] = invoice
|
||||
|
||||
|
||||
for picking in picking_obj.browse(cursor, user, picking_ids,
|
||||
context=context):
|
||||
|
||||
|
@ -135,15 +135,15 @@ class stock_picking(osv.osv):
|
|||
continue
|
||||
sale_lines = picking.sale_id.order_line
|
||||
invoice_created = invoices[result[picking.id]]
|
||||
|
||||
|
||||
for inv in invoice_obj.browse(cursor, user, [invoice_created.id], context=context):
|
||||
if not inv.fiscal_position:
|
||||
invoice_obj.write(cursor, user, [inv.id], {'fiscal_position': picking.sale_id.fiscal_position.id}, context=context)
|
||||
|
||||
|
||||
if picking.sale_id.client_order_ref:
|
||||
inv_name = picking.sale_id.client_order_ref + " : " + invoice_created.name
|
||||
invoice_obj.write(cursor, user, [invoice_created.id], {'name': inv_name}, context=context)
|
||||
|
||||
|
||||
for sale_line in sale_lines:
|
||||
if sale_line.product_id.type == 'service' and sale_line.invoiced == False:
|
||||
if group:
|
||||
|
@ -189,7 +189,7 @@ class stock_picking(osv.osv):
|
|||
})
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context={}):
|
||||
res = super(stock_picking, self).action_cancel(cr, uid, ids, context=context)
|
||||
for pick in self.browse(cr, uid, ids, context):
|
||||
|
@ -200,13 +200,9 @@ class stock_picking(osv.osv):
|
|||
call_ship_end = False
|
||||
break
|
||||
if call_ship_end:
|
||||
self.pool.get('sale.order').action_ship_end(cr, uid, [pick.sale_id.id], context)
|
||||
self.pool.get('sale.order').action_ship_end(cr, uid, [pick.sale_id.id], context)
|
||||
return res
|
||||
|
||||
|
||||
stock_picking()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -12,16 +12,16 @@
|
|||
</record>
|
||||
|
||||
<!--
|
||||
Request link
|
||||
-->
|
||||
Request link
|
||||
-->
|
||||
<record id="req_link_tracking" model="res.request.link">
|
||||
<field name="name">Production Lot</field>
|
||||
<field name="object">stock.production.lot</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Resource: stock.location
|
||||
-->
|
||||
Resource: stock.location
|
||||
-->
|
||||
<record id="stock_location_locations" model="stock.location">
|
||||
<field name="name">Physical Locations</field>
|
||||
<field name="usage">view</field>
|
||||
|
@ -41,6 +41,7 @@
|
|||
<field name="name">Scraped</field>
|
||||
<field name="location_id" ref="stock_location_locations_virtual"/>
|
||||
<field name="scrap_location">True</field>
|
||||
<field name="usage">inventory</field>
|
||||
</record>
|
||||
|
||||
<record id="location_inventory" model="stock.location">
|
||||
|
@ -85,8 +86,8 @@
|
|||
</record>
|
||||
|
||||
<!--
|
||||
Properties
|
||||
-->
|
||||
Properties
|
||||
-->
|
||||
<record forcecreate="True" id="property_stock_supplier" model="ir.property">
|
||||
<field name="name">property_stock_supplier</field>
|
||||
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_stock_supplier')]"/>
|
||||
|
@ -115,8 +116,8 @@
|
|||
</record>
|
||||
|
||||
<!--
|
||||
Resource: stock.warehouse
|
||||
-->
|
||||
Resource: stock.warehouse
|
||||
-->
|
||||
<record id="warehouse0" model="stock.warehouse">
|
||||
<field model="res.company" name="name" search="[]" use="name"/>
|
||||
<field name="lot_input_id" ref="stock_location_stock"/>
|
||||
|
|
Loading…
Reference in New Issue