[MERGE]
bzr revid: qdp-launchpad@tinyerp.com-20100618135904-yaeuvylyoqytksyw
This commit is contained in:
@@ -96,6 +96,8 @@
|
||||
<field name="search_view_id" ref="view_email_template_account_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Configuration" parent="base.menu_tools"
|
||||
id="base.menu_lunch_survey_root" sequence="20"/>
|
||||
<menuitem name="Emails" id="menu_email_template_configuration" parent="base.menu_lunch_survey_root" />
|
||||
|
||||
<menuitem name="Email Accounts" id="menu_email_template_account_all" parent="menu_email_template_configuration" action="action_email_template_account_tree_all"/>
|
||||
|
||||
@@ -41,13 +41,20 @@ class report_pos_order(osv.osv):
|
||||
('advance','Advance'),
|
||||
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
|
||||
'State'),
|
||||
'state_2': fields.function([('to_verify', 'To Verify'), ('accepted', 'Accepted'),
|
||||
('refused', 'Refused')], string='State'),
|
||||
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
'total_discount':fields.float('Total Discount', readonly=True),
|
||||
'average_price': fields.float('Average Price', readonly=True,group_operator="avg"),
|
||||
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'nbr':fields.integer('# of Lines', readonly=True),
|
||||
'product_qty':fields.float('# of Qty', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
'statement_journal_id': fields.many2one('account.journal','Cash Register'),
|
||||
'delay_validation': fields.integer('Delay Validation'),
|
||||
'delay_payment': fields.integer('Delay Payment'),
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
@@ -63,26 +70,32 @@ class report_pos_order(osv.osv):
|
||||
to_char(po.date_order, 'YYYY') as year,
|
||||
to_char(po.date_order, 'MM') as month,
|
||||
to_char(po.date_order, 'YYYY-MM-DD') as day,
|
||||
(date(po.date_order)-date(po.date_validation)) as delay_validation,
|
||||
(date(po.date_order)-date(po.date_payment)) as delay_payment,
|
||||
po.partner_id as partner_id,
|
||||
po.state as state,
|
||||
po.state_2 as state_2,
|
||||
po.user_id as user_id,
|
||||
po.shop_id as shop_id,
|
||||
po.company_id as company_id,
|
||||
po.sale_journal as journal_id
|
||||
po.sale_journal as journal_id,
|
||||
aj.id as statement_journal_id
|
||||
|
||||
from
|
||||
pos_order as po,
|
||||
pos_order as po,account_bank_statement_line absl,account_journal as aj,
|
||||
( select pl.id as id,
|
||||
pl.product_id as product_id,
|
||||
pl.qty as product_qty,
|
||||
sum(pl.qty * pl.price_unit)- sum(pl.qty * pl.price_ded) as price_total,
|
||||
sum(pl.qty * pl.price_ded) as total_discount,
|
||||
((sum(pl.qty * pl.price_unit)-sum(pl.qty * pl.price_ded))/sum(pl.qty)*count(pl.qty))::decimal(16,2) as average_price,
|
||||
pl.order_id
|
||||
from
|
||||
pos_order_line as pl
|
||||
left join product_template pt on (pt.id=pl.product_id)
|
||||
group by
|
||||
pl.id,pl.order_id, pl.qty,pl.product_id) el
|
||||
where po.id = el.order_id
|
||||
where po.id = el.order_id and absl.pos_statement_id = po.id and aj.name = absl.journal_id
|
||||
)
|
||||
""")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Point of Sale Analysis">
|
||||
<field name="date" />
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="date_validation" invisible="1"/>
|
||||
<field name="date_payment" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
@@ -18,10 +18,15 @@
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="shop_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="statement_journal_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="nbr" sum="# of Lines"/>
|
||||
<field name="product_qty" sum="# of Qty"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="total_discount" sum="Total Discount"/>
|
||||
<field name="average_price" avg="Average Price"/>
|
||||
<field name="delay_validation"/>
|
||||
<field name="delay_payment"/>
|
||||
<field name="state" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -45,6 +50,7 @@
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="POS ordered created last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today"
|
||||
string=" Today "
|
||||
name="today"
|
||||
@@ -52,15 +58,15 @@
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="POS ordered created by today"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Accepted"
|
||||
domain="[('state_2','=',('to_verify'))]" groups="base.group_extended"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Invoiced"
|
||||
domain="[('state','=',('invoiced'))]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Paid"
|
||||
domain="[('state','=',('paid'))]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Invoiced"
|
||||
domain="[('state','=',('invoiced'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
@@ -73,14 +79,15 @@
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Salesman" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Cash Register" icon="terp-folder-orange" context="{'group_by':'statement_journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Shop" icon="terp-go-home" context="{'group_by':'shop_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!--<wizard id="wizard_schedule_task" menu="False" model="project.phase" name="phase.schedule.tasks" string="Schedule Tasks"/>-->
|
||||
<!--<wizard id="wizard_compute_task" model="project.task" menu="False" name="wizard.compute.tasks" string="Compute Task Scheduling"/>-->
|
||||
|
||||
<menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>
|
||||
<!-- <menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>-->
|
||||
<!--<menuitem id="base.menu_pm_planning" name="Planning" parent="base.menu_main" sequence="3"/>-->
|
||||
<!-- <menuitem
|
||||
action="wizard_compute_phase"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,14 +15,15 @@
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
from mx import DateTime
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
from mx import DateTime
|
||||
from tools import config
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
@@ -31,13 +32,15 @@ class sale_order_line(osv.osv):
|
||||
_columns = {
|
||||
'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'),
|
||||
}
|
||||
def invoice_line_create(self, cr, uid, ids, context={}):
|
||||
create_ids=super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
|
||||
i=0
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
line_obj = self.pool.get('account.invoice.line')
|
||||
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context=context)
|
||||
i = 0
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
self.pool.get('account.invoice.line').write(cr,uid,[create_ids[i]],{'analytics_id':line.analytics_id.id})
|
||||
i=i+1
|
||||
line_obj.write(cr, uid, [create_ids[i]], {'analytics_id':line.analytics_id.id})
|
||||
i = i+1
|
||||
return create_ids
|
||||
sale_order_line()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
sale_order_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -27,7 +27,7 @@ class sale_order(osv.osv):
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
}
|
||||
|
||||
def _get_section(self, cr, uid, context):
|
||||
def _get_section(self, cr, uid, context=None):
|
||||
return context.get('context_section_id',False)
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,11 +15,12 @@
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from osv import osv
|
||||
import pooler
|
||||
@@ -71,4 +72,5 @@ class shipping(report_sxw.rml_parse):
|
||||
# return True
|
||||
|
||||
report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/sale_delivery_report/report/shipping.rml',parser=shipping)
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
Reference in New Issue
Block a user