Merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-hbto into lp:openerp-venezuela-localization
- ovl70-fr-rev-hbto
- Merge into trunk
Proposed by
hbto [Vauxoo] http://www.vauxoo.com
Status: | Merged |
---|---|
Merged at revision: | 765 |
Proposed branch: | lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-hbto |
Merge into: | lp:openerp-venezuela-localization |
Diff against target: |
1394 lines (+798/-267) 17 files modified
l10n_ve_fiscal_requirements/__openerp__.py (+1/-1) l10n_ve_fiscal_requirements/doc/fiscal_requirements.xmi (+234/-0) l10n_ve_fiscal_requirements/model/__init__.py (+1/-0) l10n_ve_fiscal_requirements/model/account.py (+49/-0) l10n_ve_fiscal_requirements/model/invoice.py (+16/-0) l10n_ve_fiscal_requirements/model/l10n_ut.py (+4/-2) l10n_ve_fiscal_requirements/model/partner.py (+153/-19) l10n_ve_fiscal_requirements/model/res_company.py (+13/-0) l10n_ve_fiscal_requirements/model/seniat_url.py (+44/-52) l10n_ve_fiscal_requirements/view/account_invoice_view.xml (+85/-5) l10n_ve_fiscal_requirements/view/partner_view.xml (+30/-24) l10n_ve_fiscal_requirements/view/res_company_view.xml (+6/-6) l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py (+135/-121) l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py (+22/-19) l10n_ve_fiscal_requirements/wizard/update_info_partner.py (+4/-8) l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py (+0/-7) l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py (+1/-3) |
To merge this branch: | bzr merge lp:~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-hbto |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
hbto [Vauxoo] http://www.vauxoo.com | Pending | ||
Review via email: mp+138900@code.launchpad.net |
Commit message
Description of the change
Version revisada del modulo de fiscal requirements
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
1 | === modified file 'l10n_ve_fiscal_requirements/__openerp__.py' | |||
2 | --- l10n_ve_fiscal_requirements/__openerp__.py 2012-09-26 20:05:11 +0000 | |||
3 | +++ l10n_ve_fiscal_requirements/__openerp__.py 2012-12-10 03:34:20 +0000 | |||
4 | @@ -23,7 +23,7 @@ | |||
5 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
6 | 24 | ################################################################################ | 24 | ################################################################################ |
7 | 25 | { | 25 | { |
9 | 26 | "name" : "Requirements for Venezuela", | 26 | "name" : "Venezuelan Fiscal Requirements", |
10 | 27 | "version" : "0.2", | 27 | "version" : "0.2", |
11 | 28 | "author" : "Vauxoo", | 28 | "author" : "Vauxoo", |
12 | 29 | "website" : "http://vauxoo.com", | 29 | "website" : "http://vauxoo.com", |
13 | 30 | 30 | ||
14 | === added file 'l10n_ve_fiscal_requirements/doc/fiscal_requirements.xmi' | |||
15 | --- l10n_ve_fiscal_requirements/doc/fiscal_requirements.xmi 1970-01-01 00:00:00 +0000 | |||
16 | +++ l10n_ve_fiscal_requirements/doc/fiscal_requirements.xmi 2012-12-10 03:34:20 +0000 | |||
17 | @@ -0,0 +1,234 @@ | |||
18 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
19 | 2 | <XMI verified="false" xmi.version="1.2" timestamp="2012-12-01T15:25:02" xmlns:UML="http://schema.omg.org/spec/UML/1.3"> | ||
20 | 3 | <XMI.header> | ||
21 | 4 | <XMI.documentation> | ||
22 | 5 | <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter> | ||
23 | 6 | <XMI.exporterVersion>1.5.8</XMI.exporterVersion> | ||
24 | 7 | <XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding> | ||
25 | 8 | </XMI.documentation> | ||
26 | 9 | <XMI.metamodel xmi.version="1.3" href="UML.xml" xmi.name="UML"/> | ||
27 | 10 | </XMI.header> | ||
28 | 11 | <XMI.content> | ||
29 | 12 | <UML:Model isSpecification="false" isAbstract="false" isLeaf="false" xmi.id="m1" isRoot="false" name="UML Model"> | ||
30 | 13 | <UML:Namespace.ownedElement> | ||
31 | 14 | <UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="folder" name="folder"/> | ||
32 | 15 | <UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="datatype" name="datatype"/> | ||
33 | 16 | <UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Logical View" name="Logical View"> | ||
34 | 17 | <UML:Namespace.ownedElement> | ||
35 | 18 | <UML:Package stereotype="folder" visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Datatypes" name="Datatypes"> | ||
36 | 19 | <UML:Namespace.ownedElement> | ||
37 | 20 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Hhr1p6xuKJbV" name="int"/> | ||
38 | 21 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="se8bAs3OdVm5" name="char"/> | ||
39 | 22 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="LoKxVQWk5Mjs" name="bool"/> | ||
40 | 23 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="QgnlyMEo0MP9" name="float"/> | ||
41 | 24 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="CSVpvHsE4AAX" name="double"/> | ||
42 | 25 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="bgHg00XReKAc" name="short"/> | ||
43 | 26 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="eOPdjomtFFhA" name="long"/> | ||
44 | 27 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="UZPYkZ3JDKxE" name="unsigned int"/> | ||
45 | 28 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="IUdxmlXR9w4q" name="unsigned short"/> | ||
46 | 29 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="joky3R6XyV4g" name="unsigned long"/> | ||
47 | 30 | <UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="27xGSvSiN3f8" name="string"/> | ||
48 | 31 | </UML:Namespace.ownedElement> | ||
49 | 32 | </UML:Package> | ||
50 | 33 | </UML:Namespace.ownedElement> | ||
51 | 34 | <XMI.extension xmi.extender="umbrello"> | ||
52 | 35 | <diagrams> | ||
53 | 36 | <diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="0" showpackage="1" showpubliconly="1" showstereotype="1" name="class diagram" font="Sans Serif,9,-1,0,50,0,0,0,0,0" canvasheight="537" canvaswidth="811" localid="-1" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#000000" backgroundcolor="#ffffff" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="DnSQSq2Hcg6b" documentation="" showscope="1" snapgrid="0" showatts="1" type="1"> | ||
54 | 37 | <widgets/> | ||
55 | 38 | <messages/> | ||
56 | 39 | <associations/> | ||
57 | 40 | </diagram> | ||
58 | 41 | <diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="0" showpackage="1" showpubliconly="1" showstereotype="1" name="base_vat" font="Sans Serif,9,-1,0,50,0,0,0,0,0" canvasheight="537" canvaswidth="811" localid="-1" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#000000" backgroundcolor="#ffffff" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="oBZv5bkoPSkS" documentation="" showscope="1" snapgrid="0" showatts="1" type="1"> | ||
59 | 42 | <widgets/> | ||
60 | 43 | <messages/> | ||
61 | 44 | <associations/> | ||
62 | 45 | </diagram> | ||
63 | 46 | <diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="1" showpackage="1" showpubliconly="1" showstereotype="1" name="activity diagram" font="Sans Serif,9,-1,0,50,0,0,0,0,0" canvasheight="709" canvaswidth="794" localid="-1" snapcsgrid="0" showgrid="1" showops="1" griddotcolor="#808080" backgroundcolor="#ffffff" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="trxpM1WN9Tbb" documentation="" showscope="1" snapgrid="0" showatts="1" type="6"> | ||
64 | 47 | <widgets> | ||
65 | 48 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="324" showstereotype="1" y="0" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="28" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="M3Ji4xqq6NjB" postcondition="" documentation="" activitytype="0" height="28" precondition=""/> | ||
66 | 49 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="295" showstereotype="1" y="53" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="126" isinstance="0" usefillcolor="1" fillcolor="none" activityname="button_check_vat" xmi.id="yTyNvinmZkau" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
67 | 50 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="283" showstereotype="1" y="460" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="20" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="m4HvVsUqtlYv" postcondition="" documentation="" activitytype="4" height="20" precondition=""/> | ||
68 | 51 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="110" showstereotype="1" y="675" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="30" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="gMlmjSwhwu2p" postcondition="" documentation="" activitytype="2" height="30" precondition=""/> | ||
69 | 52 | <notewidget width="60" showstereotype="1" x="542" noteType="0" usesdiagramusefillcolor="1" y="501" usesdiagramfillcolor="1" isinstance="0" fillcolor="none" height="30" linecolor="none" xmi.id="cpaCXA4JCJCh" usefillcolor="1" linewidth="none" font="Sans Serif,9,-1,0,50,0,0,0,0,0" text=""/> | ||
70 | 53 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="228" showstereotype="1" y="551" text="Failed vat validity" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="113" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="9eX2O5v4Rgp8" height="18"/> | ||
71 | 54 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="70" showstereotype="1" y="573" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="120" isinstance="0" usefillcolor="1" fillcolor="none" activityname="Message Error!!!" xmi.id="8lp2frqHeORC" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
72 | 55 | <regionwidget width="339" showstereotype="1" x="42" usesdiagramusefillcolor="1" y="157" usesdiagramfillcolor="1" isinstance="0" fillcolor="none" height="362" linecolor="none" regionname="" xmi.id="BR7opZyL2R3p" usefillcolor="1" documentation="" linewidth="none" font="Sans Serif,9,-1,0,50,0,0,0,0,0"/> | ||
73 | 56 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="156" showstereotype="1" y="131" text="check_vat" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="68" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="3RkKMgyKWfi3" height="18"/> | ||
74 | 57 | <notewidget width="60" showstereotype="1" x="173" noteType="0" usesdiagramusefillcolor="1" y="161" usesdiagramfillcolor="1" isinstance="0" fillcolor="none" height="30" linecolor="none" xmi.id="9FeMZFEkhMWW" usefillcolor="1" linewidth="none" font="Sans Serif,9,-1,0,50,0,0,0,0,0" text=""/> | ||
75 | 58 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="134" showstereotype="1" y="176" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="110" isinstance="0" usefillcolor="1" fillcolor="none" activityname="vat_check_vies" xmi.id="tUstutixKRHe" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
76 | 59 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="118" showstereotype="1" y="261" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="20" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="7Gzdtfe1uGNT" postcondition="" documentation="" activitytype="4" height="20" precondition=""/> | ||
77 | 60 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="252" showstereotype="1" y="270" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="110" isinstance="0" usefillcolor="1" fillcolor="none" activityname="vies_vat_check" xmi.id="WaCBughnBXe5" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
78 | 61 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="80" showstereotype="1" y="364" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="126" isinstance="0" usefillcolor="1" fillcolor="none" activityname="simple_vat_check" xmi.id="RL2jmKOtYLUP" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
79 | 62 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="91" showstereotype="1" y="460" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="101" isinstance="0" usefillcolor="1" fillcolor="none" activityname="check_vat_ve" xmi.id="09QvNmMtMW2G" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
80 | 63 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="156" showstereotype="1" y="258" text="rc.check_vies = True" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="131" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="Dk1MFdReyROk" height="18"/> | ||
81 | 64 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="283" showstereotype="1" y="365" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="20" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="lkbH56h3D7ya" postcondition="" documentation="" activitytype="4" height="20" precondition=""/> | ||
82 | 65 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="237" showstereotype="1" y="355" text="failed" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="41" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="tJSDnUR0CSMS" height="18"/> | ||
83 | 66 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="332" showstereotype="1" y="452" text="successed" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="70" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="4l42DQnyAMED" height="18"/> | ||
84 | 67 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="57" showstereotype="1" y="304" text="rc.check_vies = False" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="136" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="6XIJxdj1On2b" height="18"/> | ||
85 | 68 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="427" showstereotype="1" y="462" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="20" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="EnYM9maafrBf" postcondition="" documentation="" activitytype="4" height="20" precondition=""/> | ||
86 | 69 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="416" showstereotype="1" y="346" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="81" isinstance="0" usefillcolor="1" fillcolor="none" activityname="update_rif" xmi.id="2NXZzbr667N1" postcondition="" documentation="" activitytype="1" height="24" precondition=""/> | ||
87 | 70 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="422" showstereotype="1" y="413" text="VE vat" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="47" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="k619r3i5qGSx" height="18"/> | ||
88 | 71 | <floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="513" showstereotype="1" y="451" text="NOn VE vat" font="Sans Serif,9,-1,0,50,0,0,0,0,0" pretext="" role="700" width="77" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="00XfrjJt4oQ4" height="18"/> | ||
89 | 72 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="647" showstereotype="1" y="640" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="15" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="NF8TNVT7ZUEQ" postcondition="" documentation="" activitytype="2" height="15" precondition=""/> | ||
90 | 73 | <activitywidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="642" showstereotype="1" y="465" font="Sans Serif,9,-1,0,50,0,0,0,0,0" width="20" isinstance="0" usefillcolor="1" fillcolor="none" activityname="" xmi.id="XxWLBwICwopl" postcondition="" documentation="" activitytype="4" height="20" precondition=""/> | ||
91 | 74 | </widgets> | ||
92 | 75 | <messages/> | ||
93 | 76 | <associations> | ||
94 | 77 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="yTyNvinmZkau" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="M3Ji4xqq6NjB" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="2" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
95 | 78 | <linepath> | ||
96 | 79 | <startpoint startx="336" starty="28"/> | ||
97 | 80 | <endpoint endx="336" endy="53"/> | ||
98 | 81 | </linepath> | ||
99 | 82 | </assocwidget> | ||
100 | 83 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="8lp2frqHeORC" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="m4HvVsUqtlYv" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="0" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
101 | 84 | <linepath> | ||
102 | 85 | <startpoint startx="295" starty="480"/> | ||
103 | 86 | <endpoint endx="190" endy="575"/> | ||
104 | 87 | <point x="295" y="575"/> | ||
105 | 88 | </linepath> | ||
106 | 89 | </assocwidget> | ||
107 | 90 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="gMlmjSwhwu2p" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="8lp2frqHeORC" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="0" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
108 | 91 | <linepath> | ||
109 | 92 | <startpoint startx="128" starty="597"/> | ||
110 | 93 | <endpoint endx="128" endy="675"/> | ||
111 | 94 | </linepath> | ||
112 | 95 | </assocwidget> | ||
113 | 96 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="BR7opZyL2R3p" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="yTyNvinmZkau" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="99" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
114 | 97 | <linepath> | ||
115 | 98 | <startpoint startx="297" starty="77"/> | ||
116 | 99 | <endpoint endx="297" endy="157"/> | ||
117 | 100 | </linepath> | ||
118 | 101 | </assocwidget> | ||
119 | 102 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="7Gzdtfe1uGNT" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="tUstutixKRHe" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="185" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
120 | 103 | <linepath> | ||
121 | 104 | <startpoint startx="138" starty="200"/> | ||
122 | 105 | <endpoint endx="138" endy="261"/> | ||
123 | 106 | </linepath> | ||
124 | 107 | </assocwidget> | ||
125 | 108 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="WaCBughnBXe5" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="7Gzdtfe1uGNT" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="0" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
126 | 109 | <linepath> | ||
127 | 110 | <startpoint startx="138" starty="276"/> | ||
128 | 111 | <endpoint endx="252" endy="276"/> | ||
129 | 112 | </linepath> | ||
130 | 113 | </assocwidget> | ||
131 | 114 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="138" widgetbid="09QvNmMtMW2G" indexb="1" linewidth="none" usesdiagramusefillcolor="10" totalcounta="2" totalcountb="2" widgetaid="RL2jmKOtYLUP" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="72" fillcolor="none" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
132 | 115 | <linepath> | ||
133 | 116 | <startpoint startx="132" starty="388"/> | ||
134 | 117 | <endpoint endx="132" endy="460"/> | ||
135 | 118 | </linepath> | ||
136 | 119 | </assocwidget> | ||
137 | 120 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="32" widgetbid="lkbH56h3D7ya" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="WaCBughnBXe5" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="10" fillcolor="none" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
138 | 121 | <linepath> | ||
139 | 122 | <startpoint startx="292" starty="294"/> | ||
140 | 123 | <endpoint endx="292" endy="365"/> | ||
141 | 124 | </linepath> | ||
142 | 125 | </assocwidget> | ||
143 | 126 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="RL2jmKOtYLUP" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="lkbH56h3D7ya" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="0" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
144 | 127 | <linepath> | ||
145 | 128 | <startpoint startx="283" starty="375"/> | ||
146 | 129 | <endpoint endx="206" endy="375"/> | ||
147 | 130 | </linepath> | ||
148 | 131 | </assocwidget> | ||
149 | 132 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="m4HvVsUqtlYv" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="lkbH56h3D7ya" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="51" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
150 | 133 | <linepath> | ||
151 | 134 | <startpoint startx="292" starty="385"/> | ||
152 | 135 | <endpoint endx="292" endy="460"/> | ||
153 | 136 | </linepath> | ||
154 | 137 | </assocwidget> | ||
155 | 138 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="m4HvVsUqtlYv" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="09QvNmMtMW2G" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="137" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
156 | 139 | <linepath> | ||
157 | 140 | <startpoint startx="192" starty="470"/> | ||
158 | 141 | <endpoint endx="283" endy="470"/> | ||
159 | 142 | </linepath> | ||
160 | 143 | </assocwidget> | ||
161 | 144 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="RL2jmKOtYLUP" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="7Gzdtfe1uGNT" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="141" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
162 | 145 | <linepath> | ||
163 | 146 | <startpoint startx="118" starty="281"/> | ||
164 | 147 | <endpoint endx="118" endy="364"/> | ||
165 | 148 | </linepath> | ||
166 | 149 | </assocwidget> | ||
167 | 150 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="EnYM9maafrBf" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="m4HvVsUqtlYv" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="21" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
168 | 151 | <linepath> | ||
169 | 152 | <startpoint startx="303" starty="471"/> | ||
170 | 153 | <endpoint endx="427" endy="471"/> | ||
171 | 154 | </linepath> | ||
172 | 155 | </assocwidget> | ||
173 | 156 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="161" widgetbid="2NXZzbr667N1" indexb="1" linewidth="none" usesdiagramusefillcolor="10" totalcounta="2" totalcountb="2" widgetaid="EnYM9maafrBf" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="168" fillcolor="none" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
174 | 157 | <linepath> | ||
175 | 158 | <startpoint startx="437" starty="462"/> | ||
176 | 159 | <endpoint endx="437" endy="370"/> | ||
177 | 160 | </linepath> | ||
178 | 161 | </assocwidget> | ||
179 | 162 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="XxWLBwICwopl" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="2NXZzbr667N1" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="198" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
180 | 163 | <linepath> | ||
181 | 164 | <startpoint startx="497" starty="364"/> | ||
182 | 165 | <endpoint endx="652" endy="465"/> | ||
183 | 166 | <point x="653" y="364"/> | ||
184 | 167 | <point x="652" y="435"/> | ||
185 | 168 | </linepath> | ||
186 | 169 | </assocwidget> | ||
187 | 170 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="82" widgetbid="NF8TNVT7ZUEQ" indexb="1" linewidth="none" usesdiagramusefillcolor="8" totalcounta="2" totalcountb="2" widgetaid="XxWLBwICwopl" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="16" fillcolor="none" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
188 | 171 | <linepath> | ||
189 | 172 | <startpoint startx="653" starty="485"/> | ||
190 | 173 | <endpoint endx="653" endy="640"/> | ||
191 | 174 | </linepath> | ||
192 | 175 | </assocwidget> | ||
193 | 176 | <assocwidget indexa="1" roleBdoc="" linecolor="none" usesdiagramfillcolor="0" widgetbid="XxWLBwICwopl" indexb="1" linewidth="none" usesdiagramusefillcolor="0" totalcounta="2" totalcountb="2" widgetaid="EnYM9maafrBf" roleAdoc="" visibilityA="0" visibilityB="0" usefillcolor="198" fillcolor="#000000" changeabilityA="900" changeabilityB="900" documentation="" type="515"> | ||
194 | 177 | <linepath> | ||
195 | 178 | <startpoint startx="447" starty="476"/> | ||
196 | 179 | <endpoint endx="642" endy="476"/> | ||
197 | 180 | </linepath> | ||
198 | 181 | </assocwidget> | ||
199 | 182 | </associations> | ||
200 | 183 | </diagram> | ||
201 | 184 | </diagrams> | ||
202 | 185 | </XMI.extension> | ||
203 | 186 | </UML:Model> | ||
204 | 187 | <UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Use Case View" name="Use Case View"> | ||
205 | 188 | <UML:Namespace.ownedElement/> | ||
206 | 189 | </UML:Model> | ||
207 | 190 | <UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Component View" name="Component View"> | ||
208 | 191 | <UML:Namespace.ownedElement/> | ||
209 | 192 | </UML:Model> | ||
210 | 193 | <UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Deployment View" name="Deployment View"> | ||
211 | 194 | <UML:Namespace.ownedElement/> | ||
212 | 195 | </UML:Model> | ||
213 | 196 | <UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Entity Relationship Model" name="Entity Relationship Model"> | ||
214 | 197 | <UML:Namespace.ownedElement/> | ||
215 | 198 | </UML:Model> | ||
216 | 199 | </UML:Namespace.ownedElement> | ||
217 | 200 | </UML:Model> | ||
218 | 201 | </XMI.content> | ||
219 | 202 | <XMI.extensions xmi.extender="umbrello"> | ||
220 | 203 | <docsettings viewid="trxpM1WN9Tbb" uniqueid="XxWLBwICwopl" documentation=""/> | ||
221 | 204 | <listview> | ||
222 | 205 | <listitem open="1" type="800" id="Views"> | ||
223 | 206 | <listitem open="1" type="821" id="Component View"/> | ||
224 | 207 | <listitem open="1" type="827" id="Deployment View"/> | ||
225 | 208 | <listitem open="1" type="836" id="Entity Relationship Model"/> | ||
226 | 209 | <listitem open="1" type="801" id="Logical View"> | ||
227 | 210 | <listitem open="0" type="809" id="trxpM1WN9Tbb" label="activity diagram"/> | ||
228 | 211 | <listitem open="0" type="807" id="oBZv5bkoPSkS" label="base_vat"/> | ||
229 | 212 | <listitem open="0" type="807" id="DnSQSq2Hcg6b" label="class diagram"/> | ||
230 | 213 | <listitem open="0" type="830" id="Datatypes"> | ||
231 | 214 | <listitem open="1" type="829" id="LoKxVQWk5Mjs"/> | ||
232 | 215 | <listitem open="1" type="829" id="se8bAs3OdVm5"/> | ||
233 | 216 | <listitem open="1" type="829" id="CSVpvHsE4AAX"/> | ||
234 | 217 | <listitem open="1" type="829" id="QgnlyMEo0MP9"/> | ||
235 | 218 | <listitem open="1" type="829" id="Hhr1p6xuKJbV"/> | ||
236 | 219 | <listitem open="1" type="829" id="eOPdjomtFFhA"/> | ||
237 | 220 | <listitem open="1" type="829" id="bgHg00XReKAc"/> | ||
238 | 221 | <listitem open="1" type="829" id="27xGSvSiN3f8"/> | ||
239 | 222 | <listitem open="1" type="829" id="UZPYkZ3JDKxE"/> | ||
240 | 223 | <listitem open="1" type="829" id="joky3R6XyV4g"/> | ||
241 | 224 | <listitem open="1" type="829" id="IUdxmlXR9w4q"/> | ||
242 | 225 | </listitem> | ||
243 | 226 | </listitem> | ||
244 | 227 | <listitem open="1" type="802" id="Use Case View"/> | ||
245 | 228 | </listitem> | ||
246 | 229 | </listview> | ||
247 | 230 | <codegeneration> | ||
248 | 231 | <codegenerator language="C++"/> | ||
249 | 232 | </codegeneration> | ||
250 | 233 | </XMI.extensions> | ||
251 | 234 | </XMI> | ||
252 | 0 | 235 | ||
253 | === modified file 'l10n_ve_fiscal_requirements/model/__init__.py' | |||
254 | --- l10n_ve_fiscal_requirements/model/__init__.py 2012-11-29 19:13:14 +0000 | |||
255 | +++ l10n_ve_fiscal_requirements/model/__init__.py 2012-12-10 03:34:20 +0000 | |||
256 | @@ -22,6 +22,7 @@ | |||
257 | 22 | # You should have received a copy of the GNU Affero General Public License | 22 | # You should have received a copy of the GNU Affero General Public License |
258 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
259 | 24 | ################################################################################ | 24 | ################################################################################ |
260 | 25 | import account | ||
261 | 25 | import invoice | 26 | import invoice |
262 | 26 | import partner | 27 | import partner |
263 | 27 | import res_company | 28 | import res_company |
264 | 28 | 29 | ||
265 | === added file 'l10n_ve_fiscal_requirements/model/account.py' | |||
266 | --- l10n_ve_fiscal_requirements/model/account.py 1970-01-01 00:00:00 +0000 | |||
267 | +++ l10n_ve_fiscal_requirements/model/account.py 2012-12-10 03:34:20 +0000 | |||
268 | @@ -0,0 +1,49 @@ | |||
269 | 1 | #!/usr/bin/python | ||
270 | 2 | # -*- encoding: utf-8 -*- | ||
271 | 3 | ########################################################################### | ||
272 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
273 | 5 | # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). | ||
274 | 6 | # All Rights Reserved | ||
275 | 7 | ###############Credits###################################################### | ||
276 | 8 | # Coded by: Vauxoo C.A. | ||
277 | 9 | # Planified by: Nhomar Hernandez | ||
278 | 10 | # Audited by: Vauxoo C.A. | ||
279 | 11 | ############################################################################# | ||
280 | 12 | # This program is free software: you can redistribute it and/or modify | ||
281 | 13 | # it under the terms of the GNU Affero General Public License as published by | ||
282 | 14 | # the Free Software Foundation, either version 3 of the License, or | ||
283 | 15 | # (at your option) any later version. | ||
284 | 16 | # | ||
285 | 17 | # This program is distributed in the hope that it will be useful, | ||
286 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
287 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
288 | 20 | # GNU Affero General Public License for more details. | ||
289 | 21 | # | ||
290 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
291 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
292 | 24 | ################################################################################ | ||
293 | 25 | |||
294 | 26 | from osv import fields, osv | ||
295 | 27 | __TYPES__ = [('sale_debit', 'Sale Debit'),('purchase_debit', 'Purchase Debit')] | ||
296 | 28 | |||
297 | 29 | __HELP__= " Select 'Sale Debit' for customer debit note journals. Select 'Purchase Debit' for supplier debit note journals." | ||
298 | 30 | |||
299 | 31 | class account_journal(osv.osv): | ||
300 | 32 | _inherit = 'account.journal' | ||
301 | 33 | |||
302 | 34 | _columns = { | ||
303 | 35 | 'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), | ||
304 | 36 | ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'), | ||
305 | 37 | ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), | ||
306 | 38 | ('situation', 'Opening/Closing Situation'),('sale_debit', 'Sale Debit'), | ||
307 | 39 | ('purchase_debit', 'Purchase Debit')], 'Type', size=32, required=True, | ||
308 | 40 | help = "Select 'Sale' for customer invoices journals."\ | ||
309 | 41 | " Select 'Purchase' for supplier invoices journals."\ | ||
310 | 42 | " Select 'Cash' or 'Bank' for journals that are used in customer or supplier payments."\ | ||
311 | 43 | " Select 'General' for miscellaneous operations journals."\ | ||
312 | 44 | " Select 'Opening/Closing Situation' for entries generated for new fiscal years."\ | ||
313 | 45 | " Select 'Sale Debit' for customer debit note journals."\ | ||
314 | 46 | " Select 'Purchase Debit' for supplier debit note journals.") | ||
315 | 47 | } | ||
316 | 48 | |||
317 | 49 | account_journal() | ||
318 | 0 | 50 | ||
319 | === modified file 'l10n_ve_fiscal_requirements/model/invoice.py' | |||
320 | --- l10n_ve_fiscal_requirements/model/invoice.py 2012-11-29 19:13:14 +0000 | |||
321 | +++ l10n_ve_fiscal_requirements/model/invoice.py 2012-12-10 03:34:20 +0000 | |||
322 | @@ -27,6 +27,22 @@ | |||
323 | 27 | from tools.translate import _ | 27 | from tools.translate import _ |
324 | 28 | class account_invoice(osv.osv): | 28 | class account_invoice(osv.osv): |
325 | 29 | 29 | ||
326 | 30 | def _get_journal(self, cr, uid, context=None): | ||
327 | 31 | if context is None: | ||
328 | 32 | context = {} | ||
329 | 33 | journal_type_inv = context.get('journal_type', 'sale') | ||
330 | 34 | if journal_type_inv in ('sale_debit', 'purchase_debit'): | ||
331 | 35 | user = self.pool.get('res.users').browse(cr, uid, uid, context=context) | ||
332 | 36 | company_id = context.get('company_id', user.company_id.id) | ||
333 | 37 | journal_obj = self.pool.get('account.journal') | ||
334 | 38 | res = journal_obj.search(cr, uid, [('type', '=',journal_type_inv), | ||
335 | 39 | ('company_id', '=', company_id)], | ||
336 | 40 | limit=1) | ||
337 | 41 | return res and res[0] or False | ||
338 | 42 | else: | ||
339 | 43 | return super(account_invoice, self)._get_journal(cr, uid, context=context) | ||
340 | 44 | |||
341 | 45 | |||
342 | 30 | 46 | ||
343 | 31 | def _unique_invoice_per_partner(self, cr, uid, ids, context=None): | 47 | def _unique_invoice_per_partner(self, cr, uid, ids, context=None): |
344 | 32 | if context is None: context={} | 48 | if context is None: context={} |
345 | 33 | 49 | ||
346 | === modified file 'l10n_ve_fiscal_requirements/model/l10n_ut.py' | |||
347 | --- l10n_ve_fiscal_requirements/model/l10n_ut.py 2012-11-29 19:13:14 +0000 | |||
348 | +++ l10n_ve_fiscal_requirements/model/l10n_ut.py 2012-12-10 03:34:20 +0000 | |||
349 | @@ -56,7 +56,8 @@ | |||
350 | 56 | rate=cr.fetchall()[0][0] | 56 | rate=cr.fetchall()[0][0] |
351 | 57 | return rate | 57 | return rate |
352 | 58 | 58 | ||
354 | 59 | def compute(self, cr, uid, from_amount, date=False, context={}): | 59 | def compute(self, cr, uid, from_amount, date=False, context=None): |
355 | 60 | if context is None: context ={} | ||
356 | 60 | result = 0.0 | 61 | result = 0.0 |
357 | 61 | ut = self.get_amount_ut(cr, uid, date=False) | 62 | ut = self.get_amount_ut(cr, uid, date=False) |
358 | 62 | if ut: | 63 | if ut: |
359 | @@ -64,7 +65,8 @@ | |||
360 | 64 | 65 | ||
361 | 65 | return result | 66 | return result |
362 | 66 | 67 | ||
364 | 67 | def compute_ut_to_money(self, cr, uid, amount_ut, date=False, context={}): | 68 | def compute_ut_to_money(self, cr, uid, amount_ut, date=False, context=None): |
365 | 69 | if context is None: context ={} | ||
366 | 68 | money = 0.0 | 70 | money = 0.0 |
367 | 69 | ut = self.get_amount_ut(cr, uid, date) | 71 | ut = self.get_amount_ut(cr, uid, date) |
368 | 70 | if ut: | 72 | if ut: |
369 | 71 | 73 | ||
370 | === modified file 'l10n_ve_fiscal_requirements/model/partner.py' | |||
371 | --- l10n_ve_fiscal_requirements/model/partner.py 2012-11-29 19:13:14 +0000 | |||
372 | +++ l10n_ve_fiscal_requirements/model/partner.py 2012-12-10 03:34:20 +0000 | |||
373 | @@ -14,6 +14,8 @@ | |||
374 | 14 | # Miguel Delgado <miguel@openerp.com.ve> | 14 | # Miguel Delgado <miguel@openerp.com.ve> |
375 | 15 | # Israel FermÃn Montilla <israel@openerp.com.ve> | 15 | # Israel FermÃn Montilla <israel@openerp.com.ve> |
376 | 16 | # Juan Márquez <jmarquez@tecvemar.com.ve> | 16 | # Juan Márquez <jmarquez@tecvemar.com.ve> |
377 | 17 | # Humberto Arocha <hbto@vauxoo.com> | ||
378 | 18 | # Yanina Aular <yanina.aular@vauxoo.com> | ||
379 | 17 | # | 19 | # |
380 | 18 | # This program is free software: you can redistribute it and/or modify | 20 | # This program is free software: you can redistribute it and/or modify |
381 | 19 | # it under the terms of the GNU Affero General Public License as | 21 | # it under the terms of the GNU Affero General Public License as |
382 | @@ -30,17 +32,36 @@ | |||
383 | 30 | # | 32 | # |
384 | 31 | ############################################################################## | 33 | ############################################################################## |
385 | 32 | 34 | ||
386 | 35 | from openerp.osv.orm import except_orm | ||
387 | 33 | from osv import fields, osv | 36 | from osv import fields, osv |
388 | 34 | from tools.translate import _ | 37 | from tools.translate import _ |
389 | 35 | import re | 38 | import re |
390 | 36 | 39 | ||
391 | 37 | class res_partner(osv.osv): | 40 | class res_partner(osv.osv): |
392 | 38 | _inherit = 'res.partner' | 41 | _inherit = 'res.partner' |
394 | 39 | 42 | ||
395 | 43 | def _get_country_code(self, cr, uid, context=None): | ||
396 | 44 | context = context or {} | ||
397 | 45 | user_company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id | ||
398 | 46 | return user_company.partner_id and user_company.partner_id.country_id \ | ||
399 | 47 | and user_company.partner_id.country_id.code or 'XX' | ||
400 | 48 | |||
401 | 49 | def default_get(self, cr, uid, fields, context=None): | ||
402 | 50 | context = context or {} | ||
403 | 51 | res = super(res_partner, self).default_get(cr, uid, fields, context=context) | ||
404 | 52 | res.update({'uid_country': self._get_country_code(cr,uid,context=context)}) | ||
405 | 53 | return res | ||
406 | 54 | |||
407 | 55 | def _get_uid_country(self, cr, uid, ids, field_name, args, context=None): | ||
408 | 56 | context = context or {} | ||
409 | 57 | res= {}.fromkeys(ids,self._get_country_code(cr,uid,context=context)) | ||
410 | 58 | return res | ||
411 | 59 | |||
412 | 40 | _columns = { | 60 | _columns = { |
413 | 41 | 'seniat_updated': fields.boolean('Seniat Updated', help="This field indicates if partner was updated using SENIAT button"), | 61 | 'seniat_updated': fields.boolean('Seniat Updated', help="This field indicates if partner was updated using SENIAT button"), |
414 | 62 | 'uid_country': fields.function(_get_uid_country, type='char', string="uid_country", size=20), | ||
415 | 42 | } | 63 | } |
417 | 43 | 64 | ||
418 | 44 | _default = { | 65 | _default = { |
419 | 45 | 'seniat_updated': False, | 66 | 'seniat_updated': False, |
420 | 46 | } | 67 | } |
421 | @@ -60,7 +81,7 @@ | |||
422 | 60 | ''' | 81 | ''' |
423 | 61 | def _check_partner_invoice_addr(self,cr,uid,ids,context={}): | 82 | def _check_partner_invoice_addr(self,cr,uid,ids,context={}): |
424 | 62 | partner_obj = self.browse(cr,uid,ids[0]) | 83 | partner_obj = self.browse(cr,uid,ids[0]) |
426 | 63 | if partner_obj.vat and partner_obj.vat[:2].upper() == 'VE': | 84 | if partner_obj.vat and partner_obj.vat[:2].upper() == 'VE' and not partner_obj.parent_id: |
427 | 64 | res = partner_obj.type == 'invoice' | 85 | res = partner_obj.type == 'invoice' |
428 | 65 | if res: | 86 | if res: |
429 | 66 | return True | 87 | return True |
430 | @@ -70,26 +91,132 @@ | |||
431 | 70 | return True | 91 | return True |
432 | 71 | return True | 92 | return True |
433 | 72 | 93 | ||
436 | 73 | def _check_vat_uniqueness(self, cr, uid, ids, context={}): | 94 | def _check_vat_uniqueness_def(self, cr, uid, ids, current_vat,list_node_tree, context=None): |
437 | 74 | #Check if its possible to use 'browse' in this 'read' | 95 | if context is None: context = {} |
438 | 96 | nodes = self.search(cr, uid, [] ) | ||
439 | 97 | nodes = list( set(nodes) - set(list_node_tree) ) | ||
440 | 98 | nodes = self.search(cr, uid, [('vat','=',current_vat),('id','in',nodes)] ) | ||
441 | 99 | return not nodes | ||
442 | 100 | |||
443 | 101 | def _check_vat_uniqueness(self, cr, uid, ids, context=None): | ||
444 | 102 | if context is None: context = {} | ||
445 | 103 | |||
446 | 104 | user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id | ||
447 | 105 | |||
448 | 106 | #User must be of VE | ||
449 | 107 | if not (user_company.partner_id and user_company.partner_id.country_id and user_company.partner_id.country_id.code == 'VE'): | ||
450 | 108 | return True | ||
451 | 109 | |||
452 | 75 | partner_brw = self.browse(cr, uid,ids) | 110 | partner_brw = self.browse(cr, uid,ids) |
453 | 76 | if not 'VE' in [a.country_id.code for a in partner_brw ]: | ||
454 | 77 | return True | ||
455 | 78 | |||
456 | 79 | current_vat = partner_brw[0].vat | 111 | current_vat = partner_brw[0].vat |
459 | 80 | 112 | current_parent_id = partner_brw[0].parent_id | |
460 | 81 | if not current_vat or current_vat.strip()=='': | 113 | |
461 | 114 | if not current_vat: | ||
462 | 82 | return True # Accept empty VAT's | 115 | return True # Accept empty VAT's |
467 | 83 | 116 | ||
468 | 84 | duplicates = self.read(cr, uid, self.search(cr, uid, [('vat', '=', current_vat)]), ['vat']) | 117 | #Partners without parent, must have RIF uniqueness |
469 | 85 | 118 | if not current_parent_id: | |
470 | 86 | return not current_vat in [p['vat'] for p in duplicates if p['id'] != partner_brw[0].id] | 119 | duplicates = self.browse(cr, uid, self.search(cr, uid, [('vat', '=', current_vat),('parent_id','=',None),('id','!=',partner_brw[0].id)])) |
471 | 120 | return not duplicates | ||
472 | 121 | |||
473 | 122 | currrent_is_company =partner_brw[0].is_company | ||
474 | 123 | |||
475 | 124 | #Partners that are not company and have parent_id, can't have partners' RIF that are not part of its siblings or parent | ||
476 | 125 | if(current_parent_id and not currrent_is_company): | ||
477 | 126 | list_nodes = current_parent_id.child_ids | ||
478 | 127 | list_nodes = map(lambda x: x.id, list_nodes) | ||
479 | 128 | list_nodes.append(current_parent_id.id) | ||
480 | 129 | return self._check_vat_uniqueness_def(cr, uid, ids, current_vat, list_nodes , context=context) | ||
481 | 130 | |||
482 | 131 | return True | ||
483 | 132 | |||
484 | 133 | def _check_vat_mandatory(self, cr, uid, ids, context=None): | ||
485 | 134 | '''This method will check the vat mandatoriness in partners | ||
486 | 135 | for those user logged on with a Venezuelan Company | ||
487 | 136 | |||
488 | 137 | The method will return True when: | ||
489 | 138 | *) The user's company is not from Venezuela | ||
490 | 139 | *) The partner being created is the one for the a company being created [TODO] | ||
491 | 140 | |||
492 | 141 | The method will return False when: | ||
493 | 142 | *) The user's company is from Venezuela AND the vat field is empty AND: | ||
494 | 143 | +) partner is_company=True AND parent_id is not NULL | ||
495 | 144 | +) partner with parent_id is NULL | ||
496 | 145 | +) partner with parent_id is NOT NULL AND type of address is invoice | ||
497 | 146 | ''' | ||
498 | 147 | if context is None: context = {} | ||
499 | 148 | # Avoiding Egg-Chicken Syndrome | ||
500 | 149 | # TODO: Refine this approach this is big exception | ||
501 | 150 | # One that can be handle be end user, I hope so!!! | ||
502 | 151 | if context.get('create_company',False): | ||
503 | 152 | return True | ||
504 | 153 | |||
505 | 154 | user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id | ||
506 | 155 | #Check if the user is not from a VE Company | ||
507 | 156 | if not (user_company.partner_id and user_company.partner_id.country_id and user_company.partner_id.country_id.code == 'VE'): | ||
508 | 157 | return True | ||
509 | 158 | |||
510 | 159 | partner_brw = self.browse(cr, uid,ids) | ||
511 | 160 | current_vat = partner_brw[0].vat | ||
512 | 161 | current_parent_id = partner_brw[0].parent_id | ||
513 | 162 | current_is_company =partner_brw[0].is_company | ||
514 | 163 | current_type = partner_brw[0].type | ||
515 | 164 | |||
516 | 165 | #Partners company type and with parent, not exists | ||
517 | 166 | if (current_is_company and current_parent_id): | ||
518 | 167 | return False | ||
519 | 168 | |||
520 | 169 | #Partners without parent must have vat | ||
521 | 170 | if not current_vat and not current_parent_id: | ||
522 | 171 | return False | ||
523 | 172 | |||
524 | 173 | #Partners invoice type that not be company and have parent, must have vat | ||
525 | 174 | if (current_type == 'invoice' and not current_vat and not current_is_company and current_parent_id): | ||
526 | 175 | return False | ||
527 | 176 | |||
528 | 177 | return True | ||
529 | 178 | |||
530 | 179 | def _validate(self, cr, uid, ids, context=None): | ||
531 | 180 | #In the original orm.py openerp does not allow using | ||
532 | 181 | #context within the constraint because we have to yield | ||
533 | 182 | # the same result always, | ||
534 | 183 | # we have overridden this behaviour | ||
535 | 184 | # TO ALLOW PASSING CONTEXT TO THE RESTRICTION IN RES.PARTNER | ||
536 | 185 | context = context or {} | ||
537 | 186 | lng = context.get('lang') | ||
538 | 187 | trans = self.pool.get('ir.translation') | ||
539 | 188 | error_msgs = [] | ||
540 | 189 | for constraint in self._constraints: | ||
541 | 190 | fun, msg, fields = constraint | ||
542 | 191 | # We don't pass around the context here: validation code | ||
543 | 192 | # must always yield the same results. | ||
544 | 193 | if not fun(self, cr, uid, ids, context=context): | ||
545 | 194 | # Check presence of __call__ directly instead of using | ||
546 | 195 | # callable() because it will be deprecated as of Python 3.0 | ||
547 | 196 | if hasattr(msg, '__call__'): | ||
548 | 197 | tmp_msg = msg(self, cr, uid, ids, context=context) | ||
549 | 198 | if isinstance(tmp_msg, tuple): | ||
550 | 199 | tmp_msg, params = tmp_msg | ||
551 | 200 | translated_msg = tmp_msg % params | ||
552 | 201 | else: | ||
553 | 202 | translated_msg = tmp_msg | ||
554 | 203 | else: | ||
555 | 204 | translated_msg = trans._get_source(cr, uid, self._name, 'constraint', lng, msg) | ||
556 | 205 | error_msgs.append( | ||
557 | 206 | _("Error occurred while validating the field(s) %s: %s") % (','.join(fields), translated_msg) | ||
558 | 207 | ) | ||
559 | 208 | self._invalids.update(fields) | ||
560 | 209 | if error_msgs: | ||
561 | 210 | raise except_orm('ValidateError', '\n'.join(error_msgs)) | ||
562 | 211 | else: | ||
563 | 212 | self._invalids.clear() | ||
564 | 87 | 213 | ||
565 | 88 | _constraints = [ | 214 | _constraints = [ |
566 | 215 | (_check_vat_mandatory, _("Error ! VAT is mandatory"), []), | ||
567 | 89 | (_check_vat_uniqueness, _("Error ! Partner's VAT must be a unique value or empty"), []), | 216 | (_check_vat_uniqueness, _("Error ! Partner's VAT must be a unique value or empty"), []), |
569 | 90 | (_check_partner_invoice_addr, _('Error ! The partner does not have an invoice address.'), []), | 217 | #~ (_check_partner_invoice_addr, _('Error ! The partner does not have an invoice address.'), []), |
570 | 91 | ] | 218 | ] |
572 | 92 | 219 | ||
573 | 93 | def vat_change_fiscal_requirements(self, cr, uid, ids, value, context=None): | 220 | def vat_change_fiscal_requirements(self, cr, uid, ids, value, context=None): |
574 | 94 | if context is None: | 221 | if context is None: |
575 | 95 | context={} | 222 | context={} |
576 | @@ -117,10 +244,8 @@ | |||
577 | 117 | if context is None: | 244 | if context is None: |
578 | 118 | context={} | 245 | context={} |
579 | 119 | if re.search(r'^[VJEG][0-9]{9}$', vat): | 246 | if re.search(r'^[VJEG][0-9]{9}$', vat): |
580 | 120 | context.update({'ci_pas':False}) | ||
581 | 121 | return True | 247 | return True |
584 | 122 | if re.search(r'^([0-9]{1,8}|[D][0-9]{9})$', vat): | 248 | if re.search(r'^([VE][0-9]{1,8}|[D][0-9]{9})$', vat): |
583 | 123 | context.update({'ci_pas':True}) | ||
585 | 124 | return True | 249 | return True |
586 | 125 | return False | 250 | return False |
587 | 126 | 251 | ||
588 | @@ -130,5 +255,14 @@ | |||
589 | 130 | su_obj = self.pool.get('seniat.url') | 255 | su_obj = self.pool.get('seniat.url') |
590 | 131 | return su_obj.update_rif(cr, uid, ids, context=context) | 256 | return su_obj.update_rif(cr, uid, ids, context=context) |
591 | 132 | 257 | ||
592 | 258 | def button_check_vat(self, cr, uid, ids, context=None): | ||
593 | 259 | if context is None: context = {} | ||
594 | 260 | context.update({'update_fiscal_information':True}) | ||
595 | 261 | super(res_partner, self).button_check_vat(cr, uid, ids, context=context) | ||
596 | 262 | user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id | ||
597 | 263 | if user_company.vat_check_vies: | ||
598 | 264 | # force full VIES online check | ||
599 | 265 | self.update_rif(cr, uid, ids, context=context) | ||
600 | 266 | return True | ||
601 | 133 | res_partner() | 267 | res_partner() |
602 | 134 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 268 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
603 | 135 | 269 | ||
604 | === modified file 'l10n_ve_fiscal_requirements/model/res_company.py' | |||
605 | --- l10n_ve_fiscal_requirements/model/res_company.py 2012-11-29 19:13:14 +0000 | |||
606 | +++ l10n_ve_fiscal_requirements/model/res_company.py 2012-12-10 03:34:20 +0000 | |||
607 | @@ -37,5 +37,18 @@ | |||
608 | 37 | 'jour_id': fields.many2one('account.journal', 'Journal',required=False,help="Default journal for damaged invoices"), | 37 | 'jour_id': fields.many2one('account.journal', 'Journal',required=False,help="Default journal for damaged invoices"), |
609 | 38 | 'acc_id': fields.many2one('account.account', 'Account',required=False,help="Default account used for invoices and lines from damaged invoices"), | 38 | 'acc_id': fields.many2one('account.account', 'Account',required=False,help="Default account used for invoices and lines from damaged invoices"), |
610 | 39 | } | 39 | } |
611 | 40 | |||
612 | 41 | def create(self, cr, uid, vals, context=None): | ||
613 | 42 | if context is None: context = {} | ||
614 | 43 | context.update({'create_company':True}) | ||
615 | 44 | return super(res_company, self).create(cr, uid, vals, context=context) | ||
616 | 45 | |||
617 | 46 | def write(self, cr, uid, ids, values, context=None): | ||
618 | 47 | context = context or {} | ||
619 | 48 | self.cache_restart(cr) | ||
620 | 49 | context.update({'create_company':True}) | ||
621 | 50 | return super(res_company, self).write(cr, uid, ids, values, context=context) | ||
622 | 51 | |||
623 | 52 | |||
624 | 40 | res_company() | 53 | res_company() |
625 | 41 | 54 | ||
626 | 42 | 55 | ||
627 | === modified file 'l10n_ve_fiscal_requirements/model/seniat_url.py' | |||
628 | --- l10n_ve_fiscal_requirements/model/seniat_url.py 2012-11-29 19:13:14 +0000 | |||
629 | +++ l10n_ve_fiscal_requirements/model/seniat_url.py 2012-12-10 03:34:20 +0000 | |||
630 | @@ -63,7 +63,9 @@ | |||
631 | 63 | retries -= 1 | 63 | retries -= 1 |
632 | 64 | return str_error | 64 | return str_error |
633 | 65 | 65 | ||
635 | 66 | def _buscar_porcentaje(self,rif,url): | 66 | def _buscar_porcentaje(self, cr, uid, rif): |
636 | 67 | url_obj = self.browse(cr, uid, self.search(cr, uid, []))[0] | ||
637 | 68 | url = url_obj.url_seniat + '%s' | ||
638 | 67 | context={} | 69 | context={} |
639 | 68 | html_data = self.pool.get('seniat.url')._load_url(3,url %rif) | 70 | html_data = self.pool.get('seniat.url')._load_url(3,url %rif) |
640 | 69 | html_data = unicode(html_data, 'ISO-8859-1').encode('utf-8') | 71 | html_data = unicode(html_data, 'ISO-8859-1').encode('utf-8') |
641 | @@ -84,11 +86,7 @@ | |||
642 | 84 | self.logger.info("RIF: %s Found" % rif) | 86 | self.logger.info("RIF: %s Found" % rif) |
643 | 85 | if name.count('(') > 0: | 87 | if name.count('(') > 0: |
644 | 86 | name = name[:name.index('(')].rstrip() | 88 | name = name[:name.index('(')].rstrip() |
650 | 87 | if context.get('spf_info'): | 89 | return {'name': name,'vat_subjected': vat_subjected,'vat':'VE'+rif_aux,'wh_iva_agent':wh_agent} |
646 | 88 | res= {'name': name,'vat_subjected': vat_subjected,'vat':'VE'+rif_aux,'wh_iva_agent':wh_agent} | ||
647 | 89 | else: | ||
648 | 90 | res= {'name': name,'vat_subjected': vat_subjected,'vat':'VE'+rif_aux} | ||
649 | 91 | return res | ||
651 | 92 | 90 | ||
652 | 93 | def _print_error(self, error, msg): | 91 | def _print_error(self, error, msg): |
653 | 94 | raise osv.except_osv(error,msg) | 92 | raise osv.except_osv(error,msg) |
654 | @@ -110,25 +108,41 @@ | |||
655 | 110 | return True | 108 | return True |
656 | 111 | else: | 109 | else: |
657 | 112 | return False | 110 | return False |
658 | 111 | def _get_rif(self, vat, url1, url2, context=None): | ||
659 | 112 | if context is None: context={} | ||
660 | 113 | 113 | ||
661 | 114 | def _dom_giver(self, url1, url2, url3, vat, context): | ||
662 | 115 | if context.get('ci_pas'): | ||
663 | 116 | xml_data = self._load_url(3,url3 % vat) | ||
664 | 117 | match = re.search(r'No existe el contribuyente solicitado', xml_data) | ||
665 | 118 | vat = '0'*(8-len(vat))+vat | ||
666 | 119 | match2 = re.search(r'[VJEG]'+vat+'[0-9]{1}', xml_data) | ||
667 | 120 | if match: | ||
668 | 121 | return False | ||
669 | 122 | elif match2: | ||
670 | 123 | vat = match2.group(0) | ||
671 | 124 | xml_data = self._load_url(3,url1 % vat) | 114 | xml_data = self._load_url(3,url1 % vat) |
674 | 125 | 115 | if not self._eval_seniat_data(xml_data,vat,context=context): | |
673 | 126 | if not self._eval_seniat_data(xml_data,vat,context): | ||
675 | 127 | dom = parseString(xml_data) | 116 | dom = parseString(xml_data) |
676 | 128 | return self._parse_dom(dom, vat, url2,context=context) | 117 | return self._parse_dom(dom, vat, url2,context=context) |
678 | 129 | else: | 118 | |
679 | 119 | def _dom_giver(self, cr, uid, vat, context=None): | ||
680 | 120 | if context is None: context={} | ||
681 | 121 | |||
682 | 122 | url_obj = self.browse(cr, uid, self.search(cr, uid, []))[0] | ||
683 | 123 | url1 = url_obj.name + '%s' | ||
684 | 124 | url2 = url_obj.url_seniat + '%s' | ||
685 | 125 | url3 = url_obj.url_seniat2 + '%s' | ||
686 | 126 | if re.search(r'^[VJEG][0-9]{9}$', vat): | ||
687 | 127 | '''Checked vat is a RIF''' | ||
688 | 128 | return self._get_rif(vat, url1, url2, context=context) | ||
689 | 129 | |||
690 | 130 | elif re.search(r'^([D][0-9]{9})$', vat): | ||
691 | 131 | '''Checked vat is a Passport''' | ||
692 | 132 | #TODO: NEEDS VALID NUMBERS TO CHECK THE VALIDITY AND COMPLETE THIS CODE | ||
693 | 130 | return False | 133 | return False |
694 | 131 | 134 | ||
695 | 135 | elif re.search(r'^([VE][0-9]{1,8})$', vat): | ||
696 | 136 | '''Checked vat is an ID''' | ||
697 | 137 | xml_data = self._load_url(3,url3 % str(int(vat[1:]))) | ||
698 | 138 | vat = vat[1:].rjust(8,'0') | ||
699 | 139 | match2 = re.search(r'[VE]'+vat+'[0-9]{1}', xml_data) | ||
700 | 140 | if re.search(r'No existe el contribuyente solicitado', xml_data): | ||
701 | 141 | return False | ||
702 | 142 | elif match2: | ||
703 | 143 | vat = match2.group(0) | ||
704 | 144 | return self._get_rif(vat, url1, url2, context=context) | ||
705 | 145 | |||
706 | 132 | def _update_partner(self, cr, uid, id, context=None): | 146 | def _update_partner(self, cr, uid, id, context=None): |
707 | 133 | rp_obj = self.pool.get('res.partner') | 147 | rp_obj = self.pool.get('res.partner') |
708 | 134 | rp_obj.write(cr, uid, id, {'seniat_updated': True}) | 148 | rp_obj.write(cr, uid, id, {'seniat_updated': True}) |
709 | @@ -136,47 +150,25 @@ | |||
710 | 136 | def update_rif(self, cr, uid, ids, context={}): | 150 | def update_rif(self, cr, uid, ids, context={}): |
711 | 137 | aux=[] | 151 | aux=[] |
712 | 138 | rp_obj = self.pool.get('res.partner') | 152 | rp_obj = self.pool.get('res.partner') |
713 | 139 | url_obj = self.browse(cr, uid, self.search(cr, uid, []))[0] | ||
714 | 140 | url1 = url_obj.name + '%s' | ||
715 | 141 | url2 = url_obj.url_seniat + '%s' | ||
716 | 142 | url3 = url_obj.url_seniat2 + '%s' | ||
717 | 143 | if context.get('exec_wizard'): | 153 | if context.get('exec_wizard'): |
719 | 144 | res = self._dom_giver(url1, url2, url3, context['vat'],context) | 154 | res = self._dom_giver(cr, uid, context['vat'],context=context) |
720 | 145 | if res: | 155 | if res: |
722 | 146 | self._update_partner(cr, uid, ids, context) | 156 | self._update_partner(cr, uid, ids, context=context) |
723 | 147 | return res | 157 | return res |
724 | 148 | else: | 158 | else: |
725 | 149 | return False | 159 | return False |
726 | 150 | for partner in rp_obj.browse(cr,uid,ids): | 160 | for partner in rp_obj.browse(cr,uid,ids): |
727 | 161 | if not partner.vat or partner.vat[:2]!='VE': | ||
728 | 162 | continue | ||
729 | 151 | rp_obj.write(cr, uid, partner.id, {'seniat_updated': False}) | 163 | rp_obj.write(cr, uid, partner.id, {'seniat_updated': False}) |
751 | 152 | if partner.vat and partner.type == 'invoice': | 164 | res = self._dom_giver(cr, uid, partner.vat[2:],context=context) |
752 | 153 | partner_id =partner.id | 165 | if res: |
753 | 154 | code = partner.country_id and partner.country_id.code | 166 | rp_obj.write(cr,uid,partner.id,res) |
754 | 155 | if code == 'VE': | 167 | self._update_partner(cr, uid, partner.id, context) |
734 | 156 | if rp_obj.check_vat_ve(partner.vat[2:],context): | ||
735 | 157 | res = self._dom_giver(url1, url2, url3,partner.vat[2:],context) | ||
736 | 158 | if res: | ||
737 | 159 | rp_obj.write(cr,uid,partner.id,res) | ||
738 | 160 | self._update_partner(cr, uid, partner.id, context) | ||
739 | 161 | else: | ||
740 | 162 | if not context.get('all_rif'): | ||
741 | 163 | return False | ||
742 | 164 | #~ self._print_error(_('Error'),_("Does not exist the contributor requested")) | ||
743 | 165 | else: | ||
744 | 166 | if not context.get('all_rif'): | ||
745 | 167 | return False | ||
746 | 168 | #~ self._print_error(_('Error'),_("The RIF, CI or passport are not well constructed, please check \n The format of the RIF should be for example J1234567890,CI should be 12345678, and passports must be D123456789")) | ||
747 | 169 | else: | ||
748 | 170 | if not context.get('all_rif'): | ||
749 | 171 | return False | ||
750 | 172 | #~ self._print_error(_('Error'),_("The country in invoice address is not Venezuela, can not establish connection with sSENIAT")) | ||
755 | 173 | else: | 168 | else: |
762 | 174 | if partneri and partner.type == 'invoice': | 169 | if not context.get('all_rif'): |
763 | 175 | invoices_addr_country = partner.country_id and [partner.country_id.code] | 170 | return False |
764 | 176 | if invoices_addr_country: | 171 | #~ self._print_error(_('Error'),_("The RIF, CI or passport are not well constructed, please check \n The format of the RIF should be for example J1234567890,CI should be 12345678, and passports must be D123456789")) |
759 | 177 | country = [j for j in invoices_addr_country if j] | ||
760 | 178 | if country and 'VE' in country and not context.get('all_rif',False): | ||
761 | 179 | self._print_error(_('Vat Error !'),_('The field vat is empty')) | ||
765 | 180 | return True | 172 | return True |
766 | 181 | 173 | ||
767 | 182 | def connect_seniat(self, cr, uid, ids, context={}, all_rif=False): | 174 | def connect_seniat(self, cr, uid, ids, context={}, all_rif=False): |
768 | 183 | 175 | ||
769 | === modified file 'l10n_ve_fiscal_requirements/view/account_invoice_view.xml' | |||
770 | --- l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2012-11-07 21:33:58 +0000 | |||
771 | +++ l10n_ve_fiscal_requirements/view/account_invoice_view.xml 2012-12-10 03:34:20 +0000 | |||
772 | @@ -68,7 +68,7 @@ | |||
773 | 68 | type='action' | 68 | type='action' |
774 | 69 | string='Debit Note' | 69 | string='Debit Note' |
775 | 70 | icon="gtk-execute" | 70 | icon="gtk-execute" |
777 | 71 | attrs="{'invisible':['|',('state','in',['proforma2','proforma','cancel', 'draft']),('type','in',['out_refund', 'in_refund'])]}"/> | 71 | attrs="{'invisible':['|','|',('state','in',['proforma2','proforma','cancel', 'draft']),('type','in',['out_refund', 'in_refund']),('parent_id','!=',False)]}"/> |
778 | 72 | </xpath> | 72 | </xpath> |
779 | 73 | <xpath expr="//button[@string='Refund Invoice']" position="after"> | 73 | <xpath expr="//button[@string='Refund Invoice']" position="after"> |
780 | 74 | <button name="%(action_account_invoice_parent)d" | 74 | <button name="%(action_account_invoice_parent)d" |
781 | @@ -181,9 +181,89 @@ | |||
782 | 181 | </field> | 181 | </field> |
783 | 182 | </record> | 182 | </record> |
784 | 183 | 183 | ||
789 | 184 | 184 | <record id="action_sale_debit_tree" model="ir.actions.act_window"> | |
790 | 185 | 185 | <field name="name">Customer Debit Notes</field> | |
791 | 186 | 186 | <field name="res_model">account.invoice</field> | |
792 | 187 | 187 | <field name="view_type">form</field> | |
793 | 188 | <field name="view_mode">tree,form,calendar,graph</field> | ||
794 | 189 | <field eval="False" name="view_id"/> | ||
795 | 190 | <field name="domain">[('type','=','out_invoice'),('parent_id','!=',False)]</field> | ||
796 | 191 | <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale_debit'}</field> | ||
797 | 192 | <field name="search_view_id" ref="account.view_account_invoice_filter"/> | ||
798 | 193 | <field name="help" type="html"> | ||
799 | 194 | <p class="oe_view_nocontent_create"> | ||
800 | 195 | Click to create a customer debit note. | ||
801 | 196 | </p><p> | ||
802 | 197 | OpenERP's electronic invoicing allows to ease and fasten the | ||
803 | 198 | collection of customer payments. Your customer receives the | ||
804 | 199 | invoice by email and he can pay online and/or import it | ||
805 | 200 | in his own system. | ||
806 | 201 | </p><p> | ||
807 | 202 | The discussions with your customer are automatically displayed at | ||
808 | 203 | the bottom of each invoice. | ||
809 | 204 | </p> | ||
810 | 205 | </field> | ||
811 | 206 | </record> | ||
812 | 207 | |||
813 | 208 | <record id="action_sale_debit_tree_view" model="ir.actions.act_window.view"> | ||
814 | 209 | <field eval="1" name="sequence"/> | ||
815 | 210 | <field name="view_mode">tree</field> | ||
816 | 211 | <field name="act_window_id" ref="action_sale_debit_tree"/> | ||
817 | 212 | </record> | ||
818 | 213 | |||
819 | 214 | <record id="action_sale_debit_form_view" model="ir.actions.act_window.view"> | ||
820 | 215 | <field eval="2" name="sequence"/> | ||
821 | 216 | <field name="view_mode">form</field> | ||
822 | 217 | <field name="view_id" ref="account.invoice_form"/> | ||
823 | 218 | <field name="act_window_id" ref="action_sale_debit_tree"/> | ||
824 | 219 | </record> | ||
825 | 220 | |||
826 | 221 | |||
827 | 222 | |||
828 | 223 | <menuitem action="action_sale_debit_tree" id="menu_action_sale_debit_tree" parent="account.menu_finance_receivables"/> | ||
829 | 224 | |||
830 | 225 | <record id="action_purchase_debit_tree" model="ir.actions.act_window"> | ||
831 | 226 | <field name="name">Supplier Debit Notes</field> | ||
832 | 227 | <field name="res_model">account.invoice</field> | ||
833 | 228 | <field name="view_type">form</field> | ||
834 | 229 | <field name="view_mode">tree,form,calendar,graph</field> | ||
835 | 230 | <field eval="False" name="view_id"/> | ||
836 | 231 | <field name="domain">[('type','=','in_invoice'),('parent_id','!=',False)]</field> | ||
837 | 232 | <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase_debit'}</field> | ||
838 | 233 | <field name="search_view_id" ref="account.view_account_invoice_filter"/> | ||
839 | 234 | <field name="help" type="html"> | ||
840 | 235 | <p class="oe_view_nocontent_create"> | ||
841 | 236 | Click to record a new supplier debit note. | ||
842 | 237 | </p><p> | ||
843 | 238 | You can control the invoice from your supplier according to | ||
844 | 239 | what you purchased or received. OpenERP can also generate | ||
845 | 240 | draft invoices automatically from purchase orders or receipts. | ||
846 | 241 | </p> | ||
847 | 242 | </field> | ||
848 | 243 | </record> | ||
849 | 244 | |||
850 | 245 | <record id="action_purchase_debit_tree_view" model="ir.actions.act_window.view"> | ||
851 | 246 | <field eval="1" name="sequence"/> | ||
852 | 247 | <field name="view_mode">tree</field> | ||
853 | 248 | <field name="act_window_id" ref="action_purchase_debit_tree"/> | ||
854 | 249 | </record> | ||
855 | 250 | |||
856 | 251 | <record id="action_purchase_debit_form_view" model="ir.actions.act_window.view"> | ||
857 | 252 | <field eval="2" name="sequence"/> | ||
858 | 253 | <field name="view_mode">form</field> | ||
859 | 254 | <field name="view_id" ref="account.invoice_supplier_form"/> | ||
860 | 255 | <field name="act_window_id" ref="action_purchase_debit_tree"/> | ||
861 | 256 | </record> | ||
862 | 257 | |||
863 | 258 | <menuitem action="action_purchase_debit_tree" id="menu_action_purchase_debit_tree" parent="account.menu_finance_payables"/> | ||
864 | 259 | |||
865 | 260 | <record id="account.action_invoice_tree2" model="ir.actions.act_window"> | ||
866 | 261 | <field name="domain">[('type','=','in_invoice'),('parent_id','=',False)]</field> | ||
867 | 262 | </record> | ||
868 | 263 | |||
869 | 264 | <record id="account.action_invoice_tree1" model="ir.actions.act_window"> | ||
870 | 265 | <field name="domain">[('type','=','out_invoice'),('parent_id','=',False)]</field> | ||
871 | 266 | </record> | ||
872 | 267 | |||
873 | 188 | </data> | 268 | </data> |
874 | 189 | </openerp> | 269 | </openerp> |
875 | 190 | 270 | ||
876 | === modified file 'l10n_ve_fiscal_requirements/view/partner_view.xml' | |||
877 | --- l10n_ve_fiscal_requirements/view/partner_view.xml 2012-11-06 22:01:07 +0000 | |||
878 | +++ l10n_ve_fiscal_requirements/view/partner_view.xml 2012-12-10 03:34:20 +0000 | |||
879 | @@ -3,38 +3,44 @@ | |||
880 | 3 | <data> | 3 | <data> |
881 | 4 | 4 | ||
882 | 5 | <record id="view_partner_form2" model="ir.ui.view"> | 5 | <record id="view_partner_form2" model="ir.ui.view"> |
894 | 6 | <field name="name">res.partner.vat.inherit2</field> | 6 | <field name="name">res.partner.vat.inherit2</field> |
884 | 7 | <field name="model">res.partner</field> | ||
885 | 8 | <field name="inherit_id" ref="base_vat.view_partner_form"/> | ||
886 | 9 | <field name="arch" type="xml"> | ||
887 | 10 | <field name="vat" position="replace"> | ||
888 | 11 | </field> | ||
889 | 12 | </field> | ||
890 | 13 | </record> | ||
891 | 14 | |||
892 | 15 | <record id="view_partner_form3" model="ir.ui.view"> | ||
893 | 16 | <field name="name">res.partner.vat.inherit3</field> | ||
895 | 17 | <field name="model">res.partner</field> | 7 | <field name="model">res.partner</field> |
896 | 18 | <field name="type">form</field> | 8 | <field name="type">form</field> |
897 | 19 | <field name="inherit_id" ref="base.view_partner_form"/> | 9 | <field name="inherit_id" ref="base.view_partner_form"/> |
898 | 20 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
911 | 21 | <xpath expr='//field[@name="lang"]' position='after'> | 11 | |
912 | 22 | <field name="vat" on_change="vat_change_fiscal_requirements(vat)" colspan="2"/> | 12 | <xpath expr='//button[@name="button_check_vat"]' position='replace'></xpath> |
913 | 23 | <button name="update_rif" string="Update Fiscal Information" type="object" icon="gtk-execute" colspan="2"/> | 13 | <xpath expr='//field[@name="vat"]' position='replace'></xpath> |
914 | 24 | </xpath> | 14 | |
903 | 25 | </field> | ||
904 | 26 | </record> | ||
905 | 27 | |||
906 | 28 | <record id="view_partner_form4" model="ir.ui.view"> | ||
907 | 29 | <field name="name">res.partner.vat.inherit4</field> | ||
908 | 30 | <field name="model">res.partner</field> | ||
909 | 31 | <field name="inherit_id" ref="base.view_partner_form"/> | ||
910 | 32 | <field name="arch" type="xml"> | ||
915 | 33 | <xpath expr="//field[@name='name']" position="replace"> | 15 | <xpath expr="//field[@name='name']" position="replace"> |
916 | 34 | <field name="seniat_updated" invisible="1" /> | 16 | <field name="seniat_updated" invisible="1" /> |
917 | 35 | <field name="name" attrs="{'readonly': [('seniat_updated', '!=', False)]}" /> | 17 | <field name="name" attrs="{'readonly': [('seniat_updated', '!=', False)]}" /> |
918 | 36 | </xpath> | 18 | </xpath> |
920 | 37 | </field> | 19 | |
921 | 20 | <xpath expr='//field[@name="parent_id"]' position='before'> | ||
922 | 21 | <label for="vat"/> | ||
923 | 22 | <field name="vat" colspan="2" placeholder="e.g. VE123456789" class="oe_inline" attrs="{'required':[('uid_country','=','VE'),'|','&','&',('is_company','=',False),('parent_id','!=',False),('type','=','invoice'), ('parent_id','=',False)] }" /> | ||
924 | 23 | <button name="button_check_vat" string="Check Validity" type="object" icon="gtk-execute" class="oe_inline"/> | ||
925 | 24 | <field name="uid_country" colspan="2" invisible="1"/> | ||
926 | 25 | </xpath> | ||
927 | 26 | |||
928 | 27 | <xpath expr='//field[@name="street"]' position='replace'> | ||
929 | 28 | <field name="street" placeholder="Av. Siempre Viva" colspan="2" attrs="{'required':[('uid_country','=','VE'),'|','&','&',('is_company','=',False),('parent_id','!=',False),('type','=','invoice'), ('parent_id','=',False)] }" /> | ||
930 | 29 | </xpath> | ||
931 | 30 | |||
932 | 31 | <xpath expr='//field[@name="city"]' position='replace'> | ||
933 | 32 | <field name="city" placeholder="Caracas" colspan="2" attrs="{'required':[('uid_country','=','VE'),'|','&','&',('is_company','=',False),('parent_id','!=',False),('type','=','invoice'), ('parent_id','=',False)] }" /> | ||
934 | 33 | </xpath> | ||
935 | 34 | |||
936 | 35 | <xpath expr='//field[@name="country_id"]' position='replace'> | ||
937 | 36 | <field name="country_id" placeholder="Venezuela" class="oe_no_button" options='{"no_open": True}' colspan="2" attrs="{'required':[('uid_country','=','VE'),'|','&','&',('is_company','=',False),('parent_id','!=',False),('type','=','invoice'), ('parent_id','=',False)] }" /> | ||
938 | 37 | </xpath> | ||
939 | 38 | |||
940 | 39 | <xpath expr='//field[@name="phone"]' position='replace'> | ||
941 | 40 | <field name="phone" placeholder="+58 414 432 27 20" class="oe_no_button" options='{"no_open": True}' colspan="2" attrs="{'required':[('uid_country','=','VE'),'|','&','&',('is_company','=',False),('parent_id','!=',False),('type','=','invoice'), ('parent_id','=',False)] }" /> | ||
942 | 41 | </xpath> | ||
943 | 42 | </field> | ||
944 | 38 | </record> | 43 | </record> |
945 | 44 | |||
946 | 39 | </data> | 45 | </data> |
947 | 40 | </openerp> | 46 | </openerp> |
948 | 41 | 47 | ||
949 | === modified file 'l10n_ve_fiscal_requirements/view/res_company_view.xml' | |||
950 | --- l10n_ve_fiscal_requirements/view/res_company_view.xml 2011-10-25 20:33:16 +0000 | |||
951 | +++ l10n_ve_fiscal_requirements/view/res_company_view.xml 2012-12-10 03:34:20 +0000 | |||
952 | @@ -5,15 +5,15 @@ | |||
953 | 5 | <record id="il_company_invoice_damaged" model="ir.ui.view"> | 5 | <record id="il_company_invoice_damaged" model="ir.ui.view"> |
954 | 6 | <field name="name">il_company_invoice_damaged</field> | 6 | <field name="name">il_company_invoice_damaged</field> |
955 | 7 | <field name="model">res.company</field> | 7 | <field name="model">res.company</field> |
957 | 8 | <field name="type">form</field> | 8 | <field name="priority">24</field> |
958 | 9 | <field name="inherit_id" ref="base.view_company_form"/> | 9 | <field name="inherit_id" ref="base.view_company_form"/> |
959 | 10 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
962 | 11 | <page string="Configuration" position="inside"> | 11 | <xpath expr="//group[@name='account_grp']" position="after"> |
963 | 12 | <separator string="Data used by default for invoices damaged" colspan="4"/> | 12 | <group name='fr1_grp' string='Damaged Invoices Info'> |
964 | 13 | <field name="jour_id"/> | 13 | <field name="jour_id"/> |
968 | 14 | <field name="acc_id"/> | 14 | <field name="acc_id" domain="[('type','in',('other','receivable','payable'))]"/> |
969 | 15 | <newline/> | 15 | </group> |
970 | 16 | </page> | 16 | </xpath> |
971 | 17 | </field> | 17 | </field> |
972 | 18 | </record> | 18 | </record> |
973 | 19 | </data> | 19 | </data> |
974 | 20 | 20 | ||
975 | === modified file 'l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py' | |||
976 | --- l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2012-11-07 15:19:17 +0000 | |||
977 | +++ l10n_ve_fiscal_requirements/wizard/account_invoice_debit.py 2012-12-10 03:34:20 +0000 | |||
978 | @@ -43,11 +43,16 @@ | |||
979 | 43 | obj_journal = self.pool.get('account.journal') | 43 | obj_journal = self.pool.get('account.journal') |
980 | 44 | if context is None: | 44 | if context is None: |
981 | 45 | context = {} | 45 | context = {} |
987 | 46 | journal = obj_journal.search(cr, uid, [('type', '=', 'sale')]) | 46 | journal = [] |
988 | 47 | if context.get('type', False): | 47 | company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id |
989 | 48 | if context['type'] in ('in_invoice', 'in_refund'): | 48 | company_id = context.get('company_id', company_id) |
990 | 49 | journal = obj_journal.search(cr, uid, [('type', '=', 'purchase')]) | 49 | if context.get('type', False) in ('out_invoice', 'out_refund'): |
991 | 50 | return journal and journal[0] or False | 50 | journal = obj_journal.search(cr, uid, [('type', '=', 'sale_debit'),('company_id','=',company_id)]) |
992 | 51 | elif context.get('type', False) in ('in_invoice', 'in_refund'): | ||
993 | 52 | journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_debit'),('company_id','=',company_id)]) | ||
994 | 53 | if not journal: | ||
995 | 54 | raise osv.except_osv(_('No Debit Journal !'),_("You must define a debit journal")) | ||
996 | 55 | return journal[0] | ||
997 | 51 | 56 | ||
998 | 52 | _defaults = { | 57 | _defaults = { |
999 | 53 | 'date': lambda *a: time.strftime('%Y-%m-%d'), | 58 | 'date': lambda *a: time.strftime('%Y-%m-%d'), |
1000 | @@ -65,19 +70,23 @@ | |||
1001 | 65 | #type = context.get('journal_type', 'sale_refund') | 70 | #type = context.get('journal_type', 'sale_refund') |
1002 | 66 | type = context.get('journal_type', 'sale') | 71 | type = context.get('journal_type', 'sale') |
1003 | 67 | if type in ('sale', 'sale_refund'): | 72 | if type in ('sale', 'sale_refund'): |
1005 | 68 | type = 'sale' | 73 | type = 'sale_debit' |
1006 | 69 | else: | 74 | else: |
1008 | 70 | type = 'purchase' | 75 | type = 'purchase_debit' |
1009 | 76 | company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id | ||
1010 | 77 | company_id = context.get('company_id', company_id) | ||
1011 | 71 | for field in res['fields']: | 78 | for field in res['fields']: |
1012 | 72 | if field == 'journal_id': | 79 | if field == 'journal_id': |
1014 | 73 | journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1) | 80 | journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type),('company_id','=',company_id)], context=context, limit=None, name_get_uid=1) |
1015 | 74 | res['fields'][field]['selection'] = journal_select | 81 | res['fields'][field]['selection'] = journal_select |
1016 | 75 | return res | 82 | return res |
1017 | 76 | 83 | ||
1019 | 77 | def _get_period(self, cr, uid, context={}): | 84 | def _get_period(self, cr, uid, context=None): |
1020 | 78 | """ | 85 | """ |
1021 | 79 | Return default account period value | 86 | Return default account period value |
1022 | 80 | """ | 87 | """ |
1023 | 88 | if context is None: | ||
1024 | 89 | context = {} | ||
1025 | 81 | account_period_obj = self.pool.get('account.period') | 90 | account_period_obj = self.pool.get('account.period') |
1026 | 82 | ids = account_period_obj.find(cr, uid, context=context) | 91 | ids = account_period_obj.find(cr, uid, context=context) |
1027 | 83 | period_id = False | 92 | period_id = False |
1028 | @@ -85,10 +94,12 @@ | |||
1029 | 85 | period_id = ids[0] | 94 | period_id = ids[0] |
1030 | 86 | return period_id | 95 | return period_id |
1031 | 87 | 96 | ||
1033 | 88 | def _get_orig(self, cr, uid, inv, ref, context={}): | 97 | def _get_orig(self, cr, uid, inv, ref, context=None): |
1034 | 89 | """ | 98 | """ |
1035 | 90 | Return default origin value | 99 | Return default origin value |
1036 | 91 | """ | 100 | """ |
1037 | 101 | if context is None: | ||
1038 | 102 | context = {} | ||
1039 | 92 | nro_ref = ref | 103 | nro_ref = ref |
1040 | 93 | if inv.type == 'out_invoice': | 104 | if inv.type == 'out_invoice': |
1041 | 94 | nro_ref = inv.number | 105 | nro_ref = inv.number |
1042 | @@ -114,119 +125,122 @@ | |||
1043 | 114 | if context is None: | 125 | if context is None: |
1044 | 115 | context = {} | 126 | context = {} |
1045 | 116 | 127 | ||
1157 | 117 | for form in self.read(cr, uid, ids, context=context): | 128 | form = self.browse(cr, uid, ids[0], context = context) |
1158 | 118 | created_inv = [] | 129 | created_inv = [] |
1159 | 119 | date = False | 130 | date = False |
1160 | 120 | period = False | 131 | period = False |
1161 | 121 | description = False | 132 | description = False |
1162 | 122 | company = res_users_obj.browse(cr, uid, uid, context=context).company_id | 133 | company = res_users_obj.browse(cr, uid, uid, context=context).company_id |
1163 | 123 | journal_id = form.get('journal_id', False) | 134 | journal_id = form.journal_id and form.journal_id.id or False |
1164 | 124 | for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): | 135 | inv = inv_obj.browse(cr, uid, context.get('active_ids')[0], context=context) |
1165 | 125 | if inv.state in ['draft', 'proforma2', 'cancel']: | 136 | if inv.state in ['draft', 'proforma2', 'cancel']: |
1166 | 126 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from draft/proforma/cancel invoice.')) | 137 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from draft/proforma/cancel invoice.')) |
1167 | 127 | if inv.reconciled in ('cancel', 'modify'): | 138 | if inv.reconciled in ('cancel', 'modify'): |
1168 | 128 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from invoice which is already reconciled, invoice should be unreconciled first. You can only Refund or Debit this invoice')) | 139 | raise osv.except_osv(_('Error !'), _('Can not create a debit note from invoice which is already reconciled, invoice should be unreconciled first. You can only Refund or Debit this invoice')) |
1169 | 129 | if inv.type not in ['in_invoice', 'out_invoice']: | 140 | if inv.type not in ['in_invoice', 'out_invoice']: |
1170 | 130 | raise osv.except_osv(_('Error !'), _('Can not make a debit note on a refund invoice.')) | 141 | raise osv.except_osv(_('Error !'), _('Can not make a debit note on a refund invoice.')) |
1171 | 131 | if form['period']: | 142 | if form.period: |
1172 | 132 | period = form['period'] | 143 | period = form.period.id |
1173 | 133 | else: | 144 | else: |
1174 | 134 | #Take period from the current date | 145 | #Take period from the current date |
1175 | 135 | #period = inv.period_id and inv.period_id.id or False | 146 | #period = inv.period_id and inv.period_id.id or False |
1176 | 136 | period = self._get_period(cr, uid, context) | 147 | period = self._get_period(cr, uid, context) |
1177 | 137 | 148 | ||
1178 | 138 | if not journal_id: | 149 | if not journal_id: |
1179 | 139 | journal_id = inv.journal_id.id | 150 | journal_id = inv.journal_id.id |
1180 | 140 | 151 | ||
1181 | 141 | if form['date']: | 152 | if form.date: |
1182 | 142 | date = form['date'] | 153 | date = form.date |
1183 | 143 | if not form['period']: | 154 | if not form.period.id: |
1184 | 144 | cr.execute("select name from ir_model_fields \ | 155 | cr.execute("select name from ir_model_fields \ |
1185 | 145 | where model = 'account.period' \ | 156 | where model = 'account.period' \ |
1186 | 146 | and name = 'company_id'") | 157 | and name = 'company_id'") |
1187 | 147 | result_query = cr.fetchone() | 158 | result_query = cr.fetchone() |
1188 | 148 | if result_query: | 159 | if result_query: |
1189 | 149 | #in multi company mode | 160 | #in multi company mode |
1190 | 150 | cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ | 161 | cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ |
1191 | 151 | and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,)) | 162 | and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,)) |
1192 | 152 | else: | 163 | else: |
1193 | 153 | #in mono company mode | 164 | #in mono company mode |
1194 | 154 | cr.execute("""SELECT id | 165 | cr.execute("""SELECT id |
1195 | 155 | from account_period where date(%s) | 166 | from account_period where date(%s) |
1196 | 156 | between date_start AND date_stop \ | 167 | between date_start AND date_stop \ |
1197 | 157 | limit 1 """, (date,)) | 168 | limit 1 """, (date,)) |
1198 | 158 | res = cr.fetchone() | 169 | res = cr.fetchone() |
1199 | 159 | if res: | 170 | if res: |
1200 | 160 | period = res[0] | 171 | period = res[0] |
1201 | 161 | else: | 172 | else: |
1202 | 162 | #Take current date | 173 | #Take current date |
1203 | 163 | #date = inv.date_invoice | 174 | #date = inv.date_invoice |
1204 | 164 | date = time.strftime('%Y-%m-%d') | 175 | date = time.strftime('%Y-%m-%d') |
1205 | 165 | if form['description']: | 176 | if form.description: |
1206 | 166 | description = form['description'] | 177 | description = form.description |
1207 | 167 | else: | 178 | else: |
1208 | 168 | description = inv.name | 179 | description = inv.name |
1209 | 169 | 180 | ||
1210 | 170 | if not period: | 181 | if not period: |
1211 | 171 | raise osv.except_osv(_('Data Insufficient !'), \ | 182 | raise osv.except_osv(_('Data Insufficient !'), \ |
1212 | 172 | _('No Period found on Invoice!')) | 183 | _('No Period found on Invoice!')) |
1213 | 173 | 184 | ||
1214 | 174 | #we get original data of invoice to create a new invoice that is the copy of the original | 185 | #we get original data of invoice to create a new invoice that is the copy of the original |
1215 | 175 | invoice = inv_obj.read(cr, uid, [inv.id], | 186 | invoice = inv_obj.read(cr, uid, [inv.id], |
1216 | 176 | ['name', 'type', 'number', 'reference', | 187 | ['name', 'type', 'number', 'reference', |
1217 | 177 | 'comment', 'date_due', 'partner_id', | 188 | 'comment', 'date_due', 'partner_id', |
1218 | 178 | 'partner_insite', 'partner_contact', | 189 | 'partner_insite', 'partner_contact', |
1219 | 179 | 'partner_ref', 'payment_term', 'account_id', | 190 | 'partner_ref', 'payment_term', 'account_id', |
1220 | 180 | 'currency_id', 'invoice_line', 'tax_line', | 191 | 'currency_id', 'invoice_line', 'tax_line', |
1221 | 181 | 'journal_id', 'period_id'], context=context) | 192 | 'journal_id', 'period_id'], context=context) |
1222 | 182 | invoice = invoice[0] | 193 | invoice = invoice[0] |
1223 | 183 | del invoice['id'] | 194 | del invoice['id'] |
1224 | 184 | invoice_lines = [] | 195 | invoice_lines = [] |
1225 | 185 | tax_lines = [] | 196 | tax_lines = [] |
1226 | 186 | #Add origin, parent and comment values | 197 | #Add origin, parent and comment values |
1227 | 187 | orig = self._get_orig(cr, uid, inv, invoice['reference'], context) | 198 | orig = self._get_orig(cr, uid, inv, invoice['reference'], context) |
1228 | 188 | invoice.update({ | 199 | invoice.update({ |
1229 | 189 | 'type': inv.type, | 200 | 'type': inv.type, |
1230 | 190 | 'date_invoice': date, | 201 | 'date_invoice': date, |
1231 | 191 | 'state': 'draft', | 202 | 'state': 'draft', |
1232 | 192 | 'number': False, | 203 | 'number': False, |
1233 | 193 | 'invoice_line': invoice_lines, | 204 | 'invoice_line': invoice_lines, |
1234 | 194 | 'tax_line': tax_lines, | 205 | 'tax_line': tax_lines, |
1235 | 195 | 'period_id': period, | 206 | 'period_id': period, |
1236 | 196 | 'parent_id':inv.id, | 207 | 'parent_id':inv.id, |
1237 | 197 | 'name': description, | 208 | 'name': description, |
1238 | 198 | 'origin': orig, | 209 | 'origin': orig, |
1239 | 199 | 'comment':form['comment'] | 210 | 'comment':form.comment, |
1240 | 200 | }) | 211 | 'journal_id':journal_id |
1241 | 201 | #take the id part of the tuple returned for many2one fields | 212 | }) |
1242 | 202 | for field in ('partner_id', | 213 | #take the id part of the tuple returned for many2one fields |
1243 | 203 | 'account_id', 'currency_id', 'payment_term', 'journal_id'): | 214 | for field in ('partner_id', |
1244 | 204 | invoice[field] = invoice[field] and invoice[field][0] | 215 | 'account_id', 'currency_id', 'payment_term'): |
1245 | 205 | # create the new invoice | 216 | invoice[field] = invoice[field] and invoice[field][0] |
1246 | 206 | inv_id = inv_obj.create(cr, uid, invoice, {}) | 217 | # create the new invoice |
1247 | 207 | # we compute due date | 218 | inv_id = inv_obj.create(cr, uid, invoice, {}) |
1248 | 208 | if inv.payment_term.id: | 219 | # we compute due date |
1249 | 209 | data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date) | 220 | if inv.payment_term.id: |
1250 | 210 | if 'value' in data and data['value']: | 221 | data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date) |
1251 | 211 | inv_obj.write(cr, uid, [inv_id], data['value']) | 222 | if 'value' in data and data['value']: |
1252 | 212 | created_inv.append(inv_id) | 223 | inv_obj.write(cr, uid, [inv_id], data['value']) |
1253 | 213 | #we get the view id | 224 | created_inv.append(inv_id) |
1254 | 214 | if inv.type in ('out_invoice', 'out_refund'): | 225 | #we get the view id |
1255 | 215 | xml_id = 'action_invoice_tree1' | 226 | if inv.type in ('out_invoice', 'out_refund'): |
1256 | 216 | else: | 227 | xml_id = 'action_sale_debit_tree' |
1257 | 217 | xml_id = 'action_invoice_tree2' | 228 | else: |
1258 | 218 | #we get the model | 229 | xml_id = 'action_purchase_debit_tree' |
1259 | 219 | result = mod_obj.get_object_reference(cr, uid, 'account', xml_id) | 230 | #we get the model |
1260 | 220 | id = result and result[1] or False | 231 | result = mod_obj.get_object_reference(cr, uid, 'l10n_ve_fiscal_requirements', xml_id) |
1261 | 221 | # we read the act window | 232 | id = result and result[1] or False |
1262 | 222 | result = act_obj.read(cr, uid, id, context=context) | 233 | # we read the act window |
1263 | 223 | # we add the new invoices into domain list | 234 | result = act_obj.read(cr, uid, id, context=context) |
1264 | 224 | invoice_domain = eval(result['domain']) | 235 | # we add the new invoices into domain list |
1265 | 225 | invoice_domain.append(('id', 'in', created_inv)) | 236 | invoice_domain = eval(result['domain']) |
1266 | 226 | result['domain'] = invoice_domain | 237 | invoice_domain.append(('id', 'in', created_inv)) |
1267 | 227 | return result | 238 | result['domain'] = invoice_domain |
1268 | 239 | return result | ||
1269 | 228 | 240 | ||
1270 | 229 | def invoice_debit(self, cr, uid, ids, context=None): | 241 | def invoice_debit(self, cr, uid, ids, context=None): |
1271 | 242 | if context is None: | ||
1272 | 243 | context = {} | ||
1273 | 230 | return self.compute_debit(cr, uid, ids, context=context) | 244 | return self.compute_debit(cr, uid, ids, context=context) |
1274 | 231 | 245 | ||
1275 | 232 | 246 | ||
1276 | 233 | 247 | ||
1277 | === modified file 'l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py' | |||
1278 | --- l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2012-09-26 20:44:41 +0000 | |||
1279 | +++ l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py 2012-12-10 03:34:20 +0000 | |||
1280 | @@ -35,28 +35,31 @@ | |||
1281 | 35 | 'vat_subjected':fields.boolean('Pay VAY', help='Pay VAT, in spanish known as : Contribuyente formal'), | 35 | 'vat_subjected':fields.boolean('Pay VAY', help='Pay VAT, in spanish known as : Contribuyente formal'), |
1282 | 36 | } | 36 | } |
1283 | 37 | 37 | ||
1285 | 38 | def search_partner_seniat(self, cr, uid, vat, context=None): | 38 | def search_partner_seniat(self, cr, uid, ids, context=None): |
1286 | 39 | if context is None: | 39 | if context is None: |
1287 | 40 | context={} | 40 | context={} |
1289 | 41 | aux = '' | 41 | this = self.browse(cr, uid, ids)[0] |
1290 | 42 | su_obj = self.pool.get('seniat.url') | 42 | su_obj = self.pool.get('seniat.url') |
1291 | 43 | rp_obj = self.pool.get('res.partner') | 43 | rp_obj = self.pool.get('res.partner') |
1302 | 44 | url_obj = su_obj.browse(cr, uid, su_obj.search(cr, uid, []))[0] | 44 | vat = this.vat.upper() |
1303 | 45 | url1 = url_obj.name + '%s' | 45 | res={'name': _('The requested contributor does not exist'),'vat_subjected': False,'vat':vat,'wh_iva_agent':False, 'wh_iva_rate': 0.0} |
1304 | 46 | url2 = url_obj.url_seniat + '%s' | 46 | |
1305 | 47 | url3 = url_obj.url_seniat2 + '%s' | 47 | if 'VE' in vat: |
1306 | 48 | var_vat = self.read(cr,uid,vat,['vat']) | 48 | vat = vat[2:] |
1307 | 49 | if var_vat: | 49 | |
1308 | 50 | aux = var_vat[0]['vat'] | 50 | if rp_obj.check_vat_ve(vat,context=context): |
1309 | 51 | if rp_obj.check_vat_ve(aux,context): | 51 | res = su_obj._dom_giver(cr, uid, vat,context) |
1300 | 52 | context.update({'spf_info':True}) | ||
1301 | 53 | res = su_obj._dom_giver(url1,url2,url3, aux,context) | ||
1310 | 54 | if res: | 52 | if res: |
1318 | 55 | res.update({'wh_iva_rate':su_obj._buscar_porcentaje(aux,url2)}) | 53 | res.update({'wh_iva_rate':su_obj._buscar_porcentaje(cr, uid, vat)}) |
1319 | 56 | else: | 54 | self.write(cr,uid,ids,res) |
1320 | 57 | raise osv.except_osv(_('Error'),_("Does not exist the contributor requested")) | 55 | |
1321 | 58 | self.write(cr,uid,vat,res) | 56 | return { |
1322 | 59 | 57 | 'type': 'ir.actions.act_window', | |
1323 | 60 | return False | 58 | 'res_model': 'search.info.partner.seniat', |
1324 | 61 | 59 | 'view_mode': 'form', | |
1325 | 60 | 'view_type': 'form', | ||
1326 | 61 | 'res_id': this.id, | ||
1327 | 62 | 'views': [(False, 'form')], | ||
1328 | 63 | 'target': 'new', | ||
1329 | 64 | } | ||
1330 | 62 | search_info_partner_seniat() | 65 | search_info_partner_seniat() |
1331 | 63 | 66 | ||
1332 | === modified file 'l10n_ve_fiscal_requirements/wizard/update_info_partner.py' | |||
1333 | --- l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2012-02-14 14:19:25 +0000 | |||
1334 | +++ l10n_ve_fiscal_requirements/wizard/update_info_partner.py 2012-12-10 03:34:20 +0000 | |||
1335 | @@ -32,15 +32,11 @@ | |||
1336 | 32 | 32 | ||
1337 | 33 | def update_info(self, cr, uid, ids, context={}): | 33 | def update_info(self, cr, uid, ids, context={}): |
1338 | 34 | aux=[] | 34 | aux=[] |
1339 | 35 | res_part_obj = self.pool.get('res.partner') | ||
1340 | 36 | seniat_url_obj = self.pool.get('seniat.url') | 35 | seniat_url_obj = self.pool.get('seniat.url') |
1348 | 37 | sql= '''SELECT vat FROM res_partner GROUP BY vat HAVING count(vat) > 1 ;''' | 36 | cr.execute('''SELECT id FROM res_partner WHERE vat ilike 'VE%';''') |
1349 | 38 | cr.execute(sql) | 37 | record = cr.fetchall() |
1350 | 39 | record = cr.dictfetchall() | 38 | pids = record and map(lambda x: x[0],record) or [] |
1351 | 40 | for r in record: | 39 | seniat_url_obj.connect_seniat(cr, uid, pids, context=context, all_rif=True) |
1345 | 41 | aux.append(r.values()[0]) | ||
1346 | 42 | es_partner_ids= res_part_obj.search(cr, uid, [('vat','not in',aux)]) | ||
1347 | 43 | seniat_url_obj.connect_seniat(cr, uid, es_partner_ids, context,True) | ||
1352 | 44 | return{} | 40 | return{} |
1353 | 45 | 41 | ||
1354 | 46 | 42 | ||
1355 | 47 | 43 | ||
1356 | === modified file 'l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py' | |||
1357 | --- l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2012-09-24 15:42:44 +0000 | |||
1358 | +++ l10n_ve_fiscal_requirements/wizard/wizard_invoice_nro_ctrl.py 2012-12-10 03:34:20 +0000 | |||
1359 | @@ -95,13 +95,6 @@ | |||
1360 | 95 | wizard_brw = self.browse(cr, uid, ids, context=None) | 95 | wizard_brw = self.browse(cr, uid, ids, context=None) |
1361 | 96 | wizard_deli_obj = self.pool.get('wz.picking.delivery.note') | 96 | wizard_deli_obj = self.pool.get('wz.picking.delivery.note') |
1362 | 97 | inv_id = context.get('active_id') | 97 | inv_id = context.get('active_id') |
1363 | 98 | #~ if context['menu']: | ||
1364 | 99 | #~ invoice_obj = self.pool.get('account.invoice') | ||
1365 | 100 | #~ inv_brw = invoice_obj.browse(cr, uid, invoice_obj.search(cr, uid, [], limit=1), context) | ||
1366 | 101 | #~ if inv_brw == []: | ||
1367 | 102 | #~ raise osv.except_osv(_("ERROR !"), _("You must have created at least one invoice to declare it as damaged")) | ||
1368 | 103 | #~ inv_id = inv_brw[0].id | ||
1369 | 104 | #~ inv_brw = inv_brw[0] | ||
1370 | 105 | for wizard in wizard_brw: | 98 | for wizard in wizard_brw: |
1371 | 106 | if not wizard.sure: | 99 | if not wizard.sure: |
1372 | 107 | raise osv.except_osv(_("Validation error!"), _("Please confirm that you know what you're doing by checking the option bellow!")) | 100 | raise osv.except_osv(_("Validation error!"), _("Please confirm that you know what you're doing by checking the option bellow!")) |
1373 | 108 | 101 | ||
1374 | === modified file 'l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py' | |||
1375 | --- l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py 2012-09-24 14:47:16 +0000 | |||
1376 | +++ l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py 2012-12-10 03:34:20 +0000 | |||
1377 | @@ -32,7 +32,7 @@ | |||
1378 | 32 | _description = "Wizard that changes the invoice control number" | 32 | _description = "Wizard that changes the invoice control number" |
1379 | 33 | 33 | ||
1380 | 34 | def set_noctrl(self, cr, uid, ids, context=None): | 34 | def set_noctrl(self, cr, uid, ids, context=None): |
1382 | 35 | if context==None: | 35 | if context is None: |
1383 | 36 | context={} | 36 | context={} |
1384 | 37 | data = self.pool.get('wiz.nroctrl').read(cr, uid, ids)[0] | 37 | data = self.pool.get('wiz.nroctrl').read(cr, uid, ids)[0] |
1385 | 38 | if not data['sure']: | 38 | if not data['sure']: |
1386 | @@ -41,8 +41,6 @@ | |||
1387 | 41 | n_ctrl = data['name'] | 41 | n_ctrl = data['name'] |
1388 | 42 | 42 | ||
1389 | 43 | invoice = inv_obj.browse(cr, uid, context['active_id']) | 43 | invoice = inv_obj.browse(cr, uid, context['active_id']) |
1390 | 44 | if invoice.state == 'draft': | ||
1391 | 45 | raise osv.except_osv(_("Error!"), _("You cannot change the state of a Draft invoice")) | ||
1392 | 46 | 44 | ||
1393 | 47 | inv_obj.write(cr, uid, context.get('active_id'), {'nro_ctrl': n_ctrl}, context=context) | 45 | inv_obj.write(cr, uid, context.get('active_id'), {'nro_ctrl': n_ctrl}, context=context) |
1394 | 48 | return {} | 46 | return {} |