Merge lp:~miguel-miguel/bias-trunk/addons_equitek into lp:~openbias/bias-trunk/addons_equitek

Proposed by Miguel Miguel
Status: Merged
Merged at revision: 48
Proposed branch: lp:~miguel-miguel/bias-trunk/addons_equitek
Merge into: lp:~openbias/bias-trunk/addons_equitek
Diff against target: 374 lines (+235/-14)
9 files modified
bias_customization/__init__.py (+1/-0)
bias_customization/__openerp__.py (+7/-4)
bias_customization/account/__init__.py (+3/-3)
bias_customization/sale/i18n/es_MX.po (+4/-0)
bias_customization/sale/sale.py (+32/-6)
bias_customization/sale/sale_view.xml (+24/-1)
bias_customization/voucher/__init__.py (+29/-0)
bias_customization/voucher/account_voucher.py (+52/-0)
bias_customization/voucher/account_voucher_view.xml (+83/-0)
To merge this branch: bzr merge lp:~miguel-miguel/bias-trunk/addons_equitek
Reviewer Review Type Date Requested Status
OpenBias Pending
Review via email: mp+123101@code.launchpad.net

Description of the change

Cambios en ventas. Se agrego cambios en bias_customization para validar Ordenes de Ventas.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added symlink 'bias_analytic_payment_sale'
=== target is u'../bias_trunk/bias_analytic_payment_sale/'
=== modified file 'bias_customization/__init__.py'
--- bias_customization/__init__.py 2012-03-02 17:17:07 +0000
+++ bias_customization/__init__.py 2012-09-06 14:43:22 +0000
@@ -22,6 +22,7 @@
2222
2323
24#import account24#import account
25import voucher
25#import partners26#import partners
26#import payment27#import payment
27import product28import product
2829
=== modified file 'bias_customization/__openerp__.py'
--- bias_customization/__openerp__.py 2012-03-02 17:17:07 +0000
+++ bias_customization/__openerp__.py 2012-09-06 14:43:22 +0000
@@ -30,15 +30,19 @@
30 "website" : "http://www.bias.com.mx",30 "website" : "http://www.bias.com.mx",
31 "license" : "AGPL-3",31 "license" : "AGPL-3",
32 'depends': ['base',32 'depends': ['base',
33## 'account',33 'account',
34 'account_voucher',
34 'product',35 'product',
35# 'procurement',36 'sale',
37 'bias_analytic_payment_sale',
38## 'procurement',
36## 'purchase',39## 'purchase',
37 'sale',
38## 'base_vat'40## 'base_vat'
39 ],41 ],
40 'update_xml': [42 'update_xml': [
41 'account/account_invoice_view.xml',43 'account/account_invoice_view.xml',
44# 'account/account_view.xml',
45 'voucher/account_voucher_view.xml',
42 'sale/sale_view.xml',46 'sale/sale_view.xml',
43# 'security/ir.model.access.csv',47# 'security/ir.model.access.csv',
44# 'point_of_sale/wizard/pos_borrowing.xml',48# 'point_of_sale/wizard/pos_borrowing.xml',
@@ -48,7 +52,6 @@
48# 'account/account_invoice_view.xml',52# 'account/account_invoice_view.xml',
49# 'purchase/purchase_order_report.xml',53# 'purchase/purchase_order_report.xml',
50# 'procurement/procurement_workflow.xml',54# 'procurement/procurement_workflow.xml',
51 'sale/sale_view.xml' ,
52 ],55 ],
53 'installable': True,56 'installable': True,
54 'active': False,57 'active': False,
5558
=== modified file 'bias_customization/account/__init__.py'
--- bias_customization/account/__init__.py 2011-11-03 03:33:31 +0000
+++ bias_customization/account/__init__.py 2012-09-06 14:43:22 +0000
@@ -20,10 +20,10 @@
20#20#
21##############################################################################21##############################################################################
2222
2323#import account_move_line
24import report24#import report
25#import invoice25#import invoice
26import wizard26#import wizard
2727
28# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:28# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2929
3030
=== modified file 'bias_customization/sale/i18n/es_MX.po'
--- bias_customization/sale/i18n/es_MX.po 2012-02-24 17:14:57 +0000
+++ bias_customization/sale/i18n/es_MX.po 2012-09-06 14:43:22 +0000
@@ -61,3 +61,7 @@
61msgid "Print Invoice"61msgid "Print Invoice"
62msgstr "Imprimir factura"62msgstr "Imprimir factura"
6363
64#. module: sale
65#: view:sale.order:0
66msgid "Untaxed amount"
67msgstr "Subtotal"
6468
=== modified file 'bias_customization/sale/sale.py'
--- bias_customization/sale/sale.py 2011-12-14 23:26:28 +0000
+++ bias_customization/sale/sale.py 2012-09-06 14:43:22 +0000
@@ -19,20 +19,21 @@
19#19#
20##############################################################################20##############################################################################
2121
22from datetime import datetime, timedelta
23from dateutil.relativedelta import relativedelta
24import time22import time
23from datetime import datetime
24from operator import itemgetter
2525
26import netsvc
27import pooler
26from osv import fields, osv28from osv import fields, osv
27from tools.translate import _29from tools.translate import _
28import decimal_precision as dp30import decimal_precision as dp
29import netsvc31import tools
3032
31class sale_order(osv.osv):33class sale_order(osv.osv):
32 _name = "sale.order"34 _name = "sale.order"
33 _inherit = "sale.order"35 _inherit = "sale.order"
3436
35
36 _columns = {37 _columns = {
37 'state': fields.selection([38 'state': fields.selection([
38 ('draft', 'Quotation'),39 ('draft', 'Quotation'),
@@ -45,8 +46,9 @@
45 ('done', 'Done'),46 ('done', 'Done'),
46 ('cancel', 'Cancelled')47 ('cancel', 'Cancelled')
47 ], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),48 ], 'Order State', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
48 }49 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)], 'waiting_auto': [('readonly', False)]}, help="The analytic account related to a sales order."),
4950
51 }
5052
51 def action_autorize(self, cr, uid, ids, *args):53 def action_autorize(self, cr, uid, ids, *args):
52 if not len(ids):54 if not len(ids):
@@ -54,6 +56,30 @@
54 self.write(cr, uid, ids, {'state': 'waiting_auto', })56 self.write(cr, uid, ids, {'state': 'waiting_auto', })
55 return True57 return True
5658
59 def order_autorizacion_object(self, cr, uid, ids, context=None):
60 wf_service = netsvc.LocalService("workflow")
61 if context is None: context = {}
62 res = False
63 analytic_obj = self.pool.get('account.analytic.account')
64 for sale in self.browse(cr, uid, ids, context=context):
65 if sale.state == 'waiting_auto':
66 if sale.project_id:
67 pass
68 else:
69 analytic_id = False
70 analytic_ids = analytic_obj.search(cr, uid, [('id', '=', 2)])[0]
71 if analytic_ids:
72 analytic_id = analytic_ids
73 vals = {
74 'name': sale.name,
75 'parent_id': analytic_id,
76 'partner_id': sale.partner_id.id,
77 }
78 res = analytic_obj.create(cr, uid, vals, context=context)
79 self.write(cr, uid, ids, {'project_id': res})
80 wf_service.trg_validate(uid, 'sale.order', ids[0], 'autorizacion', cr)
81 return res
82
57sale_order()83sale_order()
5884
59# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:85# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6086
=== modified file 'bias_customization/sale/sale_view.xml'
--- bias_customization/sale/sale_view.xml 2012-02-24 17:15:52 +0000
+++ bias_customization/sale/sale_view.xml 2012-09-06 14:43:22 +0000
@@ -2,6 +2,27 @@
2<openerp>2<openerp>
3 <data>3 <data>
44
5 <!-- Pagos -->
6 <record model="ir.ui.view" id="view_order_form_inherit_01">
7 <field name="name">sale.order.form.inherit.01</field>
8 <field name="model">sale.order</field>
9 <field name="type">form</field>
10 <field name="inherit_id" ref="sale.view_order_form"/>
11 <field name="arch" type="xml">
12 <field name="project_id" position="replace">
13 <field name="project_id"
14 context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}"
15 groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" /> <!-- attrs="{'required':[('state','=', 'waiting_auto')]}" -->
16 </field>
17 <button name="%(sale.action_view_sale_advance_payment_inv)d" position="replace">
18 <button name="%(sale.action_view_sale_advance_payment_inv)d" string="Advance Invoice"
19 type="action" icon="gtk-execute" states="manual" groups="base.group_extended"/>
20 </button>
21 </field>
22 </record>
23
24
25 <!-- Fin de Pagos-->
5 =============================26 =============================
6 Add button autorization on sale order27 Add button autorization on sale order
7 =============================28 =============================
@@ -11,7 +32,9 @@
11 <field name="inherit_id" ref="sale.view_order_form"/>32 <field name="inherit_id" ref="sale.view_order_form"/>
12 <field name="arch" type="xml">33 <field name="arch" type="xml">
13 <button name="button_dummy" position="after">34 <button name="button_dummy" position="after">
14 <button name="autorizacion" states="waiting_auto" string="Autorization" icon="gtk-apply" groups="account.group_account_manager"/>35 <button name="action_cancel" states="waiting_auto" string="Cancel Order" type="object" icon="gtk-cancel"/>
36 <!-- <button name="autorizacion" states="waiting_auto" string="Autorization" icon="gtk-apply" groups="account.group_account_manager"/> -->
37 <button name="order_autorizacion_object" states="waiting_auto" type="object" string="Autorization" icon="gtk-apply"/>
15 </button>38 </button>
16 </field>39 </field>
17 </record>40 </record>
1841
=== added directory 'bias_customization/voucher'
=== added file 'bias_customization/voucher/__init__.py'
--- bias_customization/voucher/__init__.py 1970-01-01 00:00:00 +0000
+++ bias_customization/voucher/__init__.py 2012-09-06 14:43:22 +0000
@@ -0,0 +1,29 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6# $Id$
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import account_voucher
24#import report
25#import invoice
26#import wizard
27
28# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
29
030
=== added file 'bias_customization/voucher/account_voucher.py'
--- bias_customization/voucher/account_voucher.py 1970-01-01 00:00:00 +0000
+++ bias_customization/voucher/account_voucher.py 2012-09-06 14:43:22 +0000
@@ -0,0 +1,52 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from lxml import etree
24
25import netsvc
26from osv import osv, fields
27import decimal_precision as dp
28from tools.translate import _
29
30
31class account_voucher_line(osv.osv):
32 _inherit = "account.voucher.line"
33
34 def onchange_amount_id(self, cr, user, ids, move_line_id, amount, context=None):
35 currency_pool = self.pool.get('res.currency')
36 currency_pool = self.pool.get('account_voucher')
37 move_line_pool = self.pool.get('account.move.line')
38 print 'amount : ', amount
39 if move_line_id:
40 move_line = move_line_pool.browse(cr, user, move_line_id, context=context)
41 print 'move_line ', move_line
42 print 'move_line_id ', move_line_id
43 print 'amount : ', amount
44 return {}
45
46 _columns = {
47 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')),
48 }
49
50
51account_voucher_line()
52# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
053
=== added file 'bias_customization/voucher/account_voucher_view.xml'
--- bias_customization/voucher/account_voucher_view.xml 1970-01-01 00:00:00 +0000
+++ bias_customization/voucher/account_voucher_view.xml 2012-09-06 14:43:22 +0000
@@ -0,0 +1,83 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <record model="ir.ui.view" id="view_voucher_line_form_inherit_01">
6 <field name="name">account.voucher.line.form.inherit.01</field>
7 <field name="model">account.voucher.line</field>
8 <field name="type">form</field>
9 <field name="inherit_id" ref="account_voucher.view_voucher_line_form"/>
10 <field name="arch" type="xml">
11 <field name="amount" position="replace">
12 <field name="amount" on_change="onchange_amount_id(move_line_id, amount)" />
13 </field>
14 </field>
15 </record>
16
17 <record model="ir.ui.view" id="view_vendor_receipt_form_inherit_01">
18 <field name="name">account.voucher.receipt.form.inherit.01</field>
19 <field name="model">account.voucher</field>
20 <field name="type">form</field>
21 <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
22 <field name="arch" type="xml">
23 <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='amount']" position="replace">
24 <field name="amount" on_change="onchange_amount_id(move_line_id, amount)" sum="Payment" />
25 </xpath>
26 </field>
27 </record>
28
29
30 <!--
31 <record model="ir.ui.view" id="view_vendor_receipt_form_inherit_01">
32 <field name="name">account.voucher.receipt.form.inherit.01</field>
33 <field name="model">account.voucher</field>
34 <field name="type">form</field>
35 <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
36 <field name="arch" type="xml">
37 <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after">
38 <field name="account_analytic_id"/>
39 </xpath>
40 <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after">
41 <field name="account_analytic_id"/>
42 </xpath>
43 </field>
44 </record>
45
46 -->
47 <!--
48 <record model="ir.ui.view" id="view_low_priority_payment_form_inherit_01">
49 <field name="name">account.voucher.payment.low.priority.form.inherit.01</field>
50 <field name="model">account.voucher</field>
51 <field name="type">form</field>
52 <field name="priority">1</field>
53 <field name="inherit_id" ref="account_voucher.view_low_priority_payment_form"/>
54 <field name="arch" type="xml">
55 <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after">
56 <field name="account_analytic_id"/>
57 </xpath>
58 <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after">
59 <field name="account_analytic_id"/>
60 </xpath>
61 </field>
62 </record>
63
64 <record model="ir.ui.view" id="view_vendor_payment_form_inherit_01">
65 <field name="name">account.voucher.payment.form.inherit.01</field>
66 <field name="model">account.voucher</field>
67 <field name="type">form</field>
68 <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
69 <field name="arch" type="xml">
70 <xpath expr="/form/notebook/page/field[@name='line_dr_ids']/tree/field[@name='account_id']" position="after">
71 <field name="account_analytic_id"/>
72 </xpath>
73 <xpath expr="/form/notebook/page/field[@name='line_cr_ids']/tree/field[@name='account_id']" position="after">
74 <field name="account_analytic_id"/>
75 </xpath>
76 </field>
77 </record>
78 -->
79 </data>
80</openerp>
81
82
83

Subscribers

People subscribed via source and target branches

to all changes: