diff --git a/addons/sale/sale_installer.py b/addons/sale/sale_installer.py
index 4197c0a370b..a8cc5432020 100644
--- a/addons/sale/sale_installer.py
+++ b/addons/sale/sale_installer.py
@@ -28,11 +28,8 @@ class sale_installer(osv.osv_memory):
_columns = {
'delivery': fields.boolean('Delivery Costs',
help="Allows you to compute delivery costs on your quotations."),
- 'sale_journal': fields.boolean('Sales and deliveries by journal',
- help="Allows you to categorise your "
- "sales and deliveries (picking lists) between different journals. "
- "This module is very helpful for bigger companies that "
- "work by departments."),
+ 'sale_journal': fields.boolean('Invoicing journals',
+ help="Allows you to group and invoice your delivery orders according to different invoicing types: daily, weekly, etc."),
'sale_layout': fields.boolean('Sales Order Layout Improvement',
help="Provides some features to improve the layout of the Sales Order reports."),
'sale_margin': fields.boolean('Margins in Sales Orders',
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 36ba5e62d81..b9eabcaa02e 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -49,9 +49,11 @@
If you have more than one shops reselling your company products, you can create and manage them from here. Whenever you will record a new quotation or sale order, it has to be linked to a shop. The shop also defines the warehouse from which the products will be delivered for each particular sale.
+
+ parent="menu_config_sale" sequence="0" />
sale.order.calendar
diff --git a/addons/sale_journal/__init__.py b/addons/sale_journal/__init__.py
index b41a4be55d1..b05803da6c6 100644
--- a/addons/sale_journal/__init__.py
+++ b/addons/sale_journal/__init__.py
@@ -20,7 +20,4 @@
##############################################################################
import sale_journal
-import report
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_journal/__openerp__.py b/addons/sale_journal/__openerp__.py
index 4fde94fc709..37fc05fd066 100644
--- a/addons/sale_journal/__openerp__.py
+++ b/addons/sale_journal/__openerp__.py
@@ -53,14 +53,9 @@
'update_xml': [
'security/ir.model.access.csv',
'sale_journal_view.xml',
- 'report/sale_journal_report_view.xml',
- 'report/picking_journal_report_view.xml',
],
'demo_xml': ['sale_journal_demo.xml'],
- 'test': [
- 'test/sale_journal.yml',
- 'test/picking_journal.yml',
- ],
+ 'test': [ ],
'installable': True,
'active': False,
'certificate': '0077661619085',
diff --git a/addons/sale_journal/report/__init__.py b/addons/sale_journal/report/__init__.py
deleted file mode 100644
index bfe23eb8cce..00000000000
--- a/addons/sale_journal/report/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-import sale_journal_report
-import picking_journal_report
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale_journal/report/picking_journal_report.py b/addons/sale_journal/report/picking_journal_report.py
deleted file mode 100644
index 74c00367838..00000000000
--- a/addons/sale_journal/report/picking_journal_report.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-from osv import fields, osv
-import tools
-from decimal_precision import decimal_precision as dp
-
-
-class sale_journal_picking_report(osv.osv):
- """
- Picking list by journal and by invoice
- """
- _name = "sale.journal.picking.report"
- _description = "Picking lists"
- _auto = False
- _columns = {
- 'name': fields.char('Year', size=64, required=False, readonly=True),
- 'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
- ('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
-
- 'invoice_state':fields.selection([
- ("invoiced", "invoiced"),
- ("2binvoiced", "to be invoiced"),
- ("none", "None")
- ], "Invoice state", readonly=True),
- 'state': fields.selection([
- ('draft', 'draft'),
- ('auto', 'waiting'),
- ('confirmed', 'confirmed'),
- ('assigned', 'assigned'),
- ('done', 'done'),
- ('cancel', 'cancel'),
- ], 'State', readonly=True),
- 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
- 'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
- 'quantity': fields.float('Quantities', readonly=True),
- 'price_total': fields.float('Total Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
- 'price_average': fields.float('Average Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
- 'count': fields.integer('# of Lines', readonly=True),
- }
- _order = 'journal_id, name desc, price_total desc'
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'sale_journal_picking_report')
-
- cr.execute("""
- create or replace view sale_journal_picking_report as (
- select
- min(l.id) as id,
- to_char(s.date, 'YYYY') as name,
- to_char(s.date, 'MM') as month,
- s.state,
- s.invoice_state,
- s.invoice_type_id,
- s.journal_id,
- sum(l.product_qty) as quantity,
- count(*) as count,
- sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
- (sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
- from stock_picking s
- right join stock_move l on (s.id=l.picking_id)
- left join sale_order_line ol on (l.sale_line_id=ol.id)
- group by s.journal_id, s.invoice_type_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state, s.invoice_state
- order by s.invoice_type_id, s.invoice_state, s.state
- )
- """)
-
-sale_journal_picking_report()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_journal/report/picking_journal_report_view.xml b/addons/sale_journal/report/picking_journal_report_view.xml
deleted file mode 100644
index 8c98b6b3928..00000000000
--- a/addons/sale_journal/report/picking_journal_report_view.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
-
- sale.journal.picking.report.tree
- sale.journal.picking.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sale.journal.picking.report.graph
- sale.journal.picking.report
- graph
-
-
-
-
-
-
-
-
-
-
-
-
- sale.journal.picking.report.search
- sale.journal.picking.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Statistics on picking to invoice
- sale.journal.picking.report
- ir.actions.act_window
- form
- tree,form
- [('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/sale_journal/report/sale_journal_report.py b/addons/sale_journal/report/sale_journal_report.py
deleted file mode 100644
index 723a7f88722..00000000000
--- a/addons/sale_journal/report/sale_journal_report.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-from osv import fields, osv
-import tools
-
-class sale_journal_report(osv.osv):
- _name = "sale.journal.report"
- _description = "Sales Orders by Journal"
- _auto = False
- _columns = {
- 'name': fields.char('Year', size=64, required=False, readonly=True),
- 'month':fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'),
- ('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'),
- ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
- 'state': fields.selection([
- ('draft', 'Quotation'),
- ('waiting_date', 'Waiting Schedule'),
- ('manual', 'Manual in progress'),
- ('progress', 'In progress'),
- ('shipping_except', 'Shipping Exception'),
- ('invoice_except', 'Invoice Exception'),
- ('done', 'Done'),
- ('cancel', 'Cancel')
- ], 'Order State', readonly=True),
- 'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal', readonly=True),
- 'quantity': fields.float('Quantities', readonly=True),
- 'price_total': fields.float('Total Price', readonly=True),
- 'price_average': fields.float('Average Price', readonly=True),
- 'count': fields.integer('# of Lines', readonly=True),
- }
-
- _order = 'journal_id, name desc,price_total desc'
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'sale_journal_report')
- cr.execute("""
- create or replace view sale_journal_report as (
- select
- min(l.id) as id,
- to_char(s.date_order, 'YYYY') as name,
- to_char(s.date_order,'MM') as month,
- s.state,
- s.journal_id,
- sum(l.product_uom_qty) as quantity,
- count(*),
- sum(l.product_uom_qty*l.price_unit) as price_total,
- (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty))::decimal(16,2) as price_average
- from sale_order s
- right join sale_order_line l on (s.id=l.order_id)
- group by s.journal_id , to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'), s.state
- )
- """)
-
-sale_journal_report()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_journal/report/sale_journal_report_view.xml b/addons/sale_journal/report/sale_journal_report_view.xml
deleted file mode 100644
index e73fdcf9785..00000000000
--- a/addons/sale_journal/report/sale_journal_report_view.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
- sale.journal.report.tree
- sale.journal.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sale.journal.report.graph
- sale.journal.report
- graph
-
-
-
-
-
-
-
-
-
-
-
- sale.journal.report.search
- sale.journal.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py
index 8cb10178f02..09902b21099 100644
--- a/addons/sale_journal/sale_journal.py
+++ b/addons/sale_journal/sale_journal.py
@@ -39,160 +39,6 @@ class sale_journal_invoice_type(osv.osv):
}
sale_journal_invoice_type()
-class sale_journal(osv.osv):
- _name = 'sale_journal.sale.journal'
- _description = 'Sale Journal'
- _columns = {
- 'name': fields.char('Journal', size=64, required=True, states={'close':[('readonly',True)]}),
- 'code': fields.char('Code', size=16, required=True, states={'close':[('readonly',True)]}),
- 'user_id': fields.many2one('res.users', 'Responsible', required=True, states={'close':[('readonly',True)]}),
- 'date': fields.date('Journal date', required=True, states={'close':[('readonly',True)]}),
- 'date_created': fields.date('Creation date', readonly=True, required=True),
- 'date_close': fields.date('Close date ', readonly=True),
- 'sale_stats_ids': fields.one2many("sale.journal.report", "journal_id", 'Sale stats', readonly=True),
- 'state': fields.selection([
- ('draft','Draft'),
- ('open','Open'),
- ('cancel','Cancel'),
- ('confirm','Confirm'),
- ('close','Close'),
- ], 'State', required=True, readonly=True),
- 'note': fields.text('Note'),
- }
- _defaults = {
- 'date': time.strftime('%Y-%m-%d'),
- 'date_created': time.strftime('%Y-%m-%d'),
- 'user_id': lambda self,cr,uid,context: uid,
- 'state': lambda self,cr,uid,context: 'draft',
- }
-
- def button_sale_cancel(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'cancel'})
- for id in ids:
- sale_ids = self.pool.get('sale.order').search(cr, uid, [('journal_id','=',id),('state','=','draft')])
- for saleid in sale_ids:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'sale.order', saleid, 'cancel', cr)
- return True
-
- def button_sale_confirm(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'confirm'})
- for id in ids:
- sale_ids = self.pool.get('sale.order').search(cr, uid, [('journal_id','=',id),('state','=','draft')])
- for saleid in sale_ids:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'sale.order', saleid, 'order_confirm', cr)
- return True
-
- def button_open(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'open'})
- return True
-
- def button_draft(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'draft'})
- return True
-
- def button_close(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'close', 'date_close':time.strftime('%Y-%m-%d')})
- return True
- def button_reset(self, cr, uid, ids, context=None):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
- def copy(self, cr, uid, id, default=None, context=None):
- """Overrides orm copy method
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of case’s IDs
- @param context: A standard dictionary for contextual values
- """
- if context is None:
- context = {}
- if default is None:
- default = {}
- default.update({'sale_stats_ids': []})
- return super(sale_journal, self).copy(cr, uid, id, default=default, context=context)
-
-sale_journal()
-
-class picking_journal(osv.osv):
- _name = 'sale_journal.picking.journal'
- _description = 'Picking Journal'
- _columns = {
- 'name': fields.char('Journal', size=64, required=True),
- 'code': fields.char('Code', size=16, required=True),
- 'user_id': fields.many2one('res.users', 'Responsible', required=True),
- 'date': fields.date('Journal date', required=True),
- 'date_created': fields.date('Creation date', readonly=True, required=True),
- 'date_close': fields.date('Close date', readonly=True),
- 'picking_stats_ids': fields.one2many("sale.journal.picking.report", "journal_id", 'Journal Stats', readonly=True),
- 'state': fields.selection([
- ('draft','Draft'),
- ('open','Open'),
- ('cancel','Cancel'),
- ('close','Close'),
- ('confirm','Confirm'),
- ], 'Creation date', required=True, readonly=True),
- 'note': fields.text('Note'),
- }
- _defaults = {
- 'date': time.strftime('%Y-%m-%d'),
- 'date_created': time.strftime('%Y-%m-%d'),
- 'user_id': lambda self,cr,uid,context: uid,
- 'state': lambda self,cr,uid,context: 'draft',
- }
- def button_picking_cancel(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'cancel'})
- for id in ids:
- pick_ids = self.pool.get('stock.picking').search(cr, uid, [('journal_id','=',id)])
- for pickid in pick_ids:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_cancel', cr)
- return True
-
- def button_open(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'open'})
- return True
-
- def button_draft(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'draft'})
- return True
-
- def button_close(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'close', 'date_close':time.strftime('%Y-%m-%d')})
- return True
-
- def button_reset(self, cr, uid, ids, context=None):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
-
- def button_picking_confirm(self, cr, uid, ids, context={}):
-
- self.write(cr, uid, ids, {'state':'confirm'})
- for id in ids:
- pick_ids = self.pool.get('stock.picking').search(cr, uid, [('journal_id','=',id)])
- for pickid in pick_ids:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_confirm', cr)
- return True
-
- def copy(self, cr, uid, id, default=None, context=None):
- """Overrides orm copy method
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of case’s IDs
- @param context: A standard dictionary for contextual values
- """
- if context is None:
- context = {}
- if default is None:
- default = {}
- default.update({'picking_stats_ids': []})
- return super(picking_journal, self).copy(cr, uid, id, default=default, context=context)
-
-picking_journal()
-
#==============================================
# sale journal inherit
#==============================================
@@ -201,22 +47,20 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'property_invoice_type': fields.property(
- 'sale_journal.invoice.type',
- type = 'many2one',
- relation = 'sale_journal.invoice.type',
- string = "Invoicing Method",
- method = True,
- view_load = True,
- group_name = "Accounting Properties",
- help = "The type of journal used for sales and picking."),
+ 'sale_journal.invoice.type',
+ type = 'many2one',
+ relation = 'sale_journal.invoice.type',
+ string = "Invoicing Method",
+ method = True,
+ view_load = True,
+ group_name = "Accounting Properties",
+ help = "The type of journal used for sales and picking."),
}
res_partner()
class picking(osv.osv):
_inherit = "stock.picking"
_columns = {
- 'journal_id': fields.many2one('sale_journal.picking.journal', 'Picking Journal', domain=[('state','!=', 'close')],help="Picking Journal"),
- 'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
}
picking()
@@ -224,7 +68,6 @@ picking()
class sale(osv.osv):
_inherit = "sale.order"
_columns = {
- 'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal', domain=[('state','not in', ('done', 'draft''cancel'))]),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
}
def action_ship_create(self, cr, uid, ids, *args):
@@ -232,18 +75,16 @@ class sale(osv.osv):
for order in self.browse(cr, uid, ids, context={}):
pids = [ x.id for x in order.picking_ids]
self.pool.get('stock.picking').write(cr, uid, pids, {
- 'invoice_type_id': order.invoice_type_id.id,
- 'sale_journal_id': order.journal_id.id
+ 'invoice_type_id': order.invoice_type_id and order.invoice_type_id.id or False,
})
return result
def onchange_partner_id(self, cr, uid, ids, part):
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
if part:
- itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
- result['value']['invoice_type_id'] = itype
+ itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type
+ if itype:
+ result['value']['invoice_type_id'] = itype.id
return result
sale()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_journal/sale_journal_data.xml b/addons/sale_journal/sale_journal_data.xml
index 3639f945c83..9d305fe9912 100644
--- a/addons/sale_journal/sale_journal_data.xml
+++ b/addons/sale_journal/sale_journal_data.xml
@@ -2,11 +2,11 @@
-
- property_invoice_type
-
-
-
+
+ property_invoice_type
+
+
+
diff --git a/addons/sale_journal/sale_journal_demo.xml b/addons/sale_journal/sale_journal_demo.xml
index 30606e25145..061a5af8544 100644
--- a/addons/sale_journal/sale_journal_demo.xml
+++ b/addons/sale_journal/sale_journal_demo.xml
@@ -2,17 +2,17 @@
-
- Daily invoicing
-
-
- Monthly invoicing
- grouped
-
+
+ Daily invoicing
+
+
+ Monthly invoicing
+ grouped
+
-
-
-
+
+
+
diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml
index 4485769cd62..ad160ec28ae 100644
--- a/addons/sale_journal/sale_journal_view.xml
+++ b/addons/sale_journal/sale_journal_view.xml
@@ -1,10 +1,5 @@
-
-
-
@@ -14,13 +9,12 @@
@@ -42,113 +36,15 @@
+ Invoice Types
sale_journal.invoice.type
form
tree,form
- Create specific invoicing types that can be maintained in your sales orders. An invoicing type can, for example, be a time lapse to be observed before billing your sales orders. Example: invoice daily, invoice every Wednesday, at end of month, etc.
+ Invoice types are used on partners, sales order and delivery orders. You can create journal to group your invoicing according to customer's needs: daily, each wednesday, monthly, etc.
-
-
-
-
-
- sale_journal.sale.journal.form
- sale_journal.sale.journal
- form
-
-
-
-
-
-
-
-
- sale_journal.sale.journal.tree
- sale_journal.sale.journal
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sale_journal.sale.journal.search
- sale_journal.sale.journal
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sale_journal.sale.journal
- form
- tree,form
- {'search_default_user_id':uid}
-
- Display and maintain the sales journals to be used in your system. A sales journal is the place where all specific sales are recorded. If you do not need more than one sales journal, just create a generic sales journal that will be the default journal to be used for all made sales.
-
-
-
-
+
@@ -159,11 +55,7 @@
-
-
-
-
-
+
@@ -177,8 +69,7 @@
-
-
+
@@ -192,9 +83,7 @@
-
-
-
+
@@ -208,9 +97,7 @@
-
-
@@ -222,8 +109,6 @@
-
-
@@ -236,9 +121,7 @@
-
-
@@ -250,8 +133,6 @@
-
-
@@ -264,73 +145,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
res.partner.journal.property.form.inherit
res.partner
@@ -338,161 +157,13 @@
-
+
+
+
+
-
-
-
-
-
- sale_journal.picking.journal.form
- sale_journal.picking.journal
- form
-
-
-
-
-
-
- sale_journal.picking.journal.tree
- sale_journal.picking.journal
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sale_journal.picking.journal.search
- sale_journal.picking.journal
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Picking Journals
- sale_journal.picking.journal
- form
- tree,form
- {'search_default_user_id':uid}
-
-
-
-
-
-
- Picking by invoice_method
- sale_journal.invoice.type
- ir.actions.act_window
- tree
-
-
-
- Picking to invoice
- stock.picking
- ir.actions.act_window
- form
- tree,form
- [('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]
-
-
-
- tree_but_open
- sale_journal.invoice.type
- Picking to invoice
-
-
-
-
-
- stock.picking.journal.search
- stock.picking
- search
-
-
-
-
-
-
-
-
-
- stock.picking.journal.search
- stock.picking
- search
-
-
-
-
-
-
-
-
-
- stock.picking.journal.search
- stock.picking
- search
-
-
-
-
-
-
-
-
-
diff --git a/addons/sale_journal/security/ir.model.access.csv b/addons/sale_journal/security/ir.model.access.csv
index dcee2bd1f4e..bc1a3b003c3 100644
--- a/addons/sale_journal/security/ir.model.access.csv
+++ b/addons/sale_journal/security/ir.model.access.csv
@@ -1,13 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_sale_journal_invoice_type_finance_invoice","sale_journal.invoice.type invoice","model_sale_journal_invoice_type","account.group_account_invoice",1,0,0,0
+"access_sale_journal_invoice_type_finance_invoice","sale_journal.invoice.type invoice","model_sale_journal_invoice_type","account.group_account_invoice",1,1,1,1
"access_sale_journal_invoice_type_partner_manager","sale_journal.invoice.type partner manager","model_sale_journal_invoice_type","base.group_partner_manager",1,0,0,0
"access_sale_journal_invoice_type_salesman","sale_journal.invoice.type salesman","model_sale_journal_invoice_type","base.group_sale_salesman",1,0,0,0
-"access_sale_journal_sale_journal","sale_journal.sale.journal","model_sale_journal_sale_journal","base.group_sale_salesman",1,0,0,0
"access_sale_journal_invoice_type_manager","sale_journal.invoice.type.manager","model_sale_journal_invoice_type","base.group_sale_manager",1,1,1,1
-"access_sale_journal_sale_journal_manager","sale_journal.sale.journal.manager","model_sale_journal_sale_journal","base.group_sale_manager",1,1,1,1
-"access_sale_journal_picking_journal_manager","sale_journal.picking.journal.manager","model_sale_journal_picking_journal","base.group_sale_manager",1,1,1,1
-"access_sale_journal_sale_journal_stock_worker","sale_journal.sale.journal stock worker","model_sale_journal_sale_journal","stock.group_stock_user",1,0,0,0
-"access_sale_journal_picking_journal_stock_worker","sale_journal.picking.journal stock worker","model_sale_journal_picking_journal","stock.group_stock_user",1,0,0,0
"access_sale_journal_invoice_type_stock_worker","sale_journal.invoice_type stock worker","model_sale_journal_invoice_type","stock.group_stock_user",1,0,0,0
-"access_sale_journal_sale_journal_report_manager","sale_journal_sale_journal_report_manager","model_sale_journal_report","base.group_sale_manager",1,1,1,1
-"access_sale_journal_picking_report","sale_journal_picking_report","model_sale_journal_picking_report","stock.group_stock_manager",1,1,1,1
diff --git a/addons/sale_journal/test/picking_journal.yml b/addons/sale_journal/test/picking_journal.yml
deleted file mode 100644
index 9412c3d40d1..00000000000
--- a/addons/sale_journal/test/picking_journal.yml
+++ /dev/null
@@ -1,87 +0,0 @@
--
- In order to test the sale_journal module in OpenERP,
- I create a picking journal
--
- !record {model: sale_journal.picking.journal, id: sale_journal_picking_journal_pickjournal0}:
- code: PJ
- date: '2010-08-04'
- date_created: '2010-08-04'
- name: Pick_journal
- state: draft
- user_id: base.user_root
--
- I create a picking for product keyboard, quantity 50
--
- !record {model: stock.picking, id: stock_picking_out0}:
- address_id: base.res_partner_address_6
- company_id: base.main_company
- invoice_state: none
- journal_id: sale_journal_picking_journal_pickjournal0
- move_lines:
- - company_id: base.main_company
- date_expected: '2010-08-04 14:09:38'
- date: '2010-08-04 14:09:38'
- location_id: stock.stock_location_stock
- product_id: product.product_product_24
- product_qty: 50.0
- product_uom: product.product_uom_unit
- location_dest_id: stock.stock_location_customers
- name: '[KEYA] Keyboard - AZERTY'
- product_uos_qty: 50.0
- move_type: direct
- name: OUT/00007
- type: out
--
- I verify that a Journal consist of picking order
--
- !python {model: sale_journal.picking.journal}: |
- pick_jour = self.browse(cr, uid, ref("sale_journal_picking_journal_pickjournal0"))
- assert pick_jour.picking_stats_ids, "Journal does not consist of a picking order"
--
- Then I click on the 'Open Journal' button
--
- !python {model: sale_journal.picking.journal}: |
- self.button_open(cr, uid, [ref("sale_journal_picking_journal_pickjournal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal_picking")],
- "active_id": ref("sale_journal.menu_definition_journal_picking")})
--
- I verify that a state of journal has transit from draft to open state
--
- !python {model: sale_journal.picking.journal}: |
- pick_jour = self.browse(cr, uid, ref("sale_journal_picking_journal_pickjournal0"))
- assert (pick_jour.state == 'open'), "Journal is not in the open state"
--
- Then I click on the 'Confirm Picking' button
--
- !python {model: sale_journal.picking.journal}: |
- self.button_picking_confirm(cr, uid, [ref("sale_journal_picking_journal_pickjournal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal_picking")],
- "active_id": ref("sale_journal.menu_definition_journal_picking")})
--
- I verify that a state of journal has transit from open to confirm state
--
- !python {model: sale_journal.picking.journal}: |
- pick_jour = self.browse(cr, uid, ref("sale_journal_picking_journal_pickjournal0"))
- assert (pick_jour.state == 'confirm'), "Journal is not in the open state"
--
- I verify that an picking order is now in the confirm state
--
- !python {model: stock.picking}: |
- pick_jour_obj = self.pool.get('sale_journal.picking.journal')
- jour = pick_jour_obj.browse(cr, uid, ref("sale_journal_picking_journal_pickjournal0"))
- stock_pick = self.browse(cr, uid, ref("stock_picking_out0"))
- pick_jour = self.search(cr, uid, [('journal_id','=',jour.name) and ('state','=','confirmed')])
- assert pick_jour, "Sale order is not in the confirm state"
--
- Then I click on the 'Close Journal' button
--
- !python {model: sale_journal.picking.journal}: |
- self.button_close(cr, uid, [ref("sale_journal_picking_journal_pickjournal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal_picking")],
- "active_id": ref("sale_journal.menu_definition_journal_picking")})
--
- I verify that a state of journal has transit from confirm to close state
--
- !python {model: sale_journal.picking.journal}: |
- pick_jour = self.browse(cr, uid, ref("sale_journal_picking_journal_pickjournal0"))
- assert (pick_jour.state == 'close'), "Journal is not in the open state"
diff --git a/addons/sale_journal/test/sale_journal.yml b/addons/sale_journal/test/sale_journal.yml
deleted file mode 100644
index 365e2640031..00000000000
--- a/addons/sale_journal/test/sale_journal.yml
+++ /dev/null
@@ -1,95 +0,0 @@
--
- In order to test the sale_journal module in OpenERP,
- I create a sale journal and place a sale order related to a journal
--
- I create a sale journal
--
- !record {model: sale_journal.sale.journal, id: sale_journal_sale_journal_journal0}:
- code: J1
- date: '2010-08-04'
- date_created: '2010-08-04'
- name: Journal_1
- state: draft
- user_id: base.user_root
--
- I place a sale order for product keyboard, quantity 100
--
- !record {model: sale.order, id: sale_order_so0}:
- date_order: '2010-08-04'
- invoice_quantity: order
- invoice_type_id: sale_journal.daily
- journal_id: sale_journal_sale_journal_journal0
- name: Test_SO012
- order_line:
- - name: '[KEYA] Keyboard - AZERTY'
- price_unit: 7.0
- product_uom: product.product_uom_unit
- product_uom_qty: 100.0
- state: draft
- delay: 7.0
- product_id: product.product_product_24
- product_uos_qty: 100.0
- th_weight: 0.0
- type: make_to_stock
- order_policy: manual
- partner_id: base.res_partner_4
- partner_invoice_id: base.res_partner_address_7
- partner_order_id: base.res_partner_address_7
- partner_shipping_id: base.res_partner_address_7
- picking_policy: direct
- pricelist_id: product.list0
- shop_id: sale.shop
--
- I verify that a Journal consist of sale order
--
- !python {model: sale_journal.sale.journal}: |
- sal_jour = self.browse(cr, uid, ref("sale_journal_sale_journal_journal0"))
- assert sal_jour.sale_stats_ids, "Journal does not consist of a sale order details"
--
- Then I click on the 'Open Journal' button
--
- !python {model: sale_journal.sale.journal}: |
- self.button_open(cr, uid, [ref("sale_journal_sale_journal_journal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal")],
- "active_id": ref("sale_journal.menu_definition_journal")})
--
- I verify that a state of journal has transit from draft to open state
--
- !python {model: sale_journal.sale.journal}: |
- sal_jour = self.browse(cr, uid, ref("sale_journal_sale_journal_journal0"))
- assert (sal_jour.state == 'open'), "Journal is not in the open state"
--
- Then I click on the 'Confirm Sales' button
--
- !python {model: sale_journal.sale.journal}: |
- self.button_sale_confirm(cr, uid, [ref("sale_journal_sale_journal_journal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal")],
- "active_id": ref("sale_journal.menu_definition_journal")})
--
- I verify that a state of journal has transit from open to confirm state
--
- !python {model: sale_journal.sale.journal}: |
- sal_jour = self.browse(cr, uid, ref("sale_journal_sale_journal_journal0"))
- assert (sal_jour.state == 'confirm'), "Journal is not in the confirm state"
--
- I verify that a sale order is now in the confirm state
--
- !python {model: sale.order}: |
- sale_jour_obj = self.pool.get('sale_journal.sale.journal')
- jour = sale_jour_obj.browse(cr, uid, ref("sale_journal_sale_journal_journal0"))
- so = self.browse(cr, uid, ref("sale_order_so0"))
- so_jour = self.search(cr, uid, [('journal_id','=',jour.name) and ('state','=','manual')])
- assert so_jour, "Sale order is not in the confirm state"
--
- Then I click on the 'Close Journal' button
--
- !python {model: sale_journal.sale.journal}: |
- self.button_close(cr, uid, [ref("sale_journal_sale_journal_journal0")], {"lang": "en_US", "search_default_user_id":
- 1, "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("sale_journal.menu_definition_journal")],
- "active_id": ref("sale_journal.menu_definition_journal")})
--
- I verify that a state of journal has transit from confirm to close state
--
- !python {model: sale_journal.sale.journal}: |
- sal_jour = self.browse(cr, uid, ref("sale_journal_sale_journal_journal0"))
- assert (sal_jour.state == 'close'), "Journal is not in the close state"
\ No newline at end of file