initial commit
This commit is contained in:
commit
4fced1741a
|
@ -0,0 +1,14 @@
|
|||
Copyright (C) 2014 NaN·tic
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
@ -0,0 +1,27 @@
|
|||
Installing
|
||||
==========
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
* see setup.py file
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Once you've downloaded and unpacked the source release, enter the
|
||||
directory where the archive was unpacked, and run:
|
||||
|
||||
python setup.py install
|
||||
|
||||
Note that you may need administrator/root privileges for this step, as
|
||||
this command will by default attempt to install module to the Python
|
||||
site-packages directory on your system.
|
||||
|
||||
For advanced options, please refer to the easy_install and/or the distutils
|
||||
documentation:
|
||||
|
||||
http://peak.telecommunity.com/DevCenter/EasyInstall
|
||||
http://docs.python.org/inst/inst.html
|
||||
|
||||
To use without installation, extract the archive into ``trytond/modules``.
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@ -0,0 +1,13 @@
|
|||
include INSTALL
|
||||
include README
|
||||
include COPYRIGHT
|
||||
include CHANGELOG
|
||||
include LICENSE
|
||||
include tryton.cfg
|
||||
include *.xml
|
||||
include view/*.xml
|
||||
include *.odt
|
||||
include locale/*.po
|
||||
include doc/*
|
||||
include icons/*
|
||||
include tests/*.rst
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
This Module runs with the Tryton application platform.
|
||||
|
||||
This module is developed and tested over a Tryton server and core modules
|
||||
patched with patches from `trytond-patches project`_ (take care with the
|
||||
branches). Maybe these patches are required for the module to work.
|
||||
|
||||
.. _trytond-patches project: https://bitbucket.org/nantic/trytond-patches
|
||||
|
||||
Installing
|
||||
----------
|
||||
|
||||
See INSTALL
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
If you encounter any problems with this module, please don't hesitate to ask
|
||||
questions on the NaN·tic bug tracker, mailing list,
|
||||
wiki or IRC channel:
|
||||
|
||||
* http://doc.tryton-erp.es/
|
||||
* http://bitbucket.org/nantic/trytond-asset_project
|
||||
* http://groups.tryton.org/
|
||||
* http://wiki.tryton.org/
|
||||
* irc://irc.freenode.net/tryton
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
See LICENSE
|
||||
|
||||
Copyright
|
||||
---------
|
||||
|
||||
See COPYRIGHT
|
||||
|
||||
|
||||
For more information please visit the NaN·tic web site:
|
||||
|
||||
http://www.nan-tic.com/
|
|
@ -0,0 +1,19 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .asset import *
|
||||
from .configuration import *
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Configuration,
|
||||
ConfigurationCompany,
|
||||
Project,
|
||||
ProjectMilestoneGroup,
|
||||
ProjectSaleLine,
|
||||
Sale,
|
||||
ShipmentWork,
|
||||
Maintenance,
|
||||
MilestoneGroup,
|
||||
module='asset_project', type_='model')
|
|
@ -0,0 +1,549 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from decimal import Decimal
|
||||
from sql.aggregate import Max, Sum, Avg
|
||||
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pyson import Eval, If, Bool
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.config import CONFIG
|
||||
DIGITS = int(CONFIG.get('unit_price_digits', 4))
|
||||
|
||||
__all__ = ['ProjectMilestoneGroup', 'ProjectSaleLine', 'Project',
|
||||
'ShipmentWork', 'Sale', 'Maintenance', 'MilestoneGroup']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
_ZERO = Decimal('0.0')
|
||||
|
||||
|
||||
class ProjectMilestoneGroup(ModelSQL):
|
||||
'Project - Milestone'
|
||||
__name__ = 'asset.project-account.invoice.milestone.group'
|
||||
_table = 'asset_project_milestone_group_rel'
|
||||
project = fields.Many2One('asset.project', 'Project', ondelete='CASCADE',
|
||||
required=True, select=True)
|
||||
milestone_group = fields.Many2One('account.invoice.milestone.group',
|
||||
'Milestone Group',
|
||||
ondelete='CASCADE', required=True, select=True)
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ProjectMilestoneGroup, cls).__setup__()
|
||||
cls._sql_constraints += [
|
||||
('project_unique', 'UNIQUE(project)',
|
||||
'The Project must be unique.'),
|
||||
('milestone_group_unique', 'UNIQUE(milestone_group)',
|
||||
'The Milestone Group must be unique.'),
|
||||
]
|
||||
|
||||
|
||||
class ProjectSaleLine(ModelSQL, ModelView):
|
||||
'Project Sale Line'
|
||||
__name__ = 'asset.project.sale.line'
|
||||
project = fields.Many2One('asset.project', 'Project', required=True)
|
||||
product = fields.Many2One('product.product', 'Product')
|
||||
quantity = fields.Float('Quantity',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits'])
|
||||
unit = fields.Many2One('product.uom', 'Unit')
|
||||
unit_digits = fields.Function(fields.Integer('Unit Digits'),
|
||||
'on_change_with_unit_digits')
|
||||
currency = fields.Many2One('currency.currency', 'Currency')
|
||||
currency_digits = fields.Function(fields.Integer('Currency Digits'),
|
||||
'on_change_with_currency_digits')
|
||||
unit_price = fields.Numeric('Unit Price', digits=(16, DIGITS))
|
||||
amount = fields.Function(fields.Numeric('Amount',
|
||||
digits=(16, Eval('currency_digits', 2)),
|
||||
depends=['currency_digits']),
|
||||
'get_amount')
|
||||
|
||||
def get_amount(self, name):
|
||||
return self.currency.round(
|
||||
Decimal(str(self.quantity)) * self.unit_price)
|
||||
|
||||
@fields.depends('unit')
|
||||
def on_change_with_unit_digits(self, name=None):
|
||||
if self.unit:
|
||||
return self.unit.digits
|
||||
return 2
|
||||
|
||||
@fields.depends('currency')
|
||||
def on_change_with_currency_digits(self, name=None):
|
||||
return self.currency.digits
|
||||
|
||||
@classmethod
|
||||
def table_query(cls):
|
||||
pool = Pool()
|
||||
Sale = pool.get('sale.sale')
|
||||
SaleLine = pool.get('sale.line')
|
||||
table = SaleLine.__table__()
|
||||
sale = Sale.__table__()
|
||||
|
||||
columns = []
|
||||
for name in ('id', 'create_uid', 'write_uid', 'create_date',
|
||||
'write_date'):
|
||||
columns.append(Max(getattr(table, name)).as_(name))
|
||||
|
||||
columns.extend([sale.project, table.product, sale.currency, table.unit,
|
||||
Sum(table.quantity).as_('quantity'),
|
||||
Avg(table.unit_price).as_('unit_price')])
|
||||
|
||||
return table.join(sale, condition=(sale.id == table.sale)).select(
|
||||
*columns,
|
||||
where=((table.type == 'line') &
|
||||
(sale.project != None) &
|
||||
(sale.state != 'cancel')
|
||||
),
|
||||
group_by=(sale.project, sale.currency, table.product, table.unit))
|
||||
|
||||
|
||||
class Project(ModelSQL, ModelView):
|
||||
'Asset Project'
|
||||
__name__ = 'asset.project'
|
||||
_rec_name = 'code'
|
||||
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
select=True, domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
])
|
||||
unit_digits = fields.Function(fields.Integer('Unit Digits'),
|
||||
'on_change_with_unit_digits')
|
||||
code = fields.Char('Code', required=True, select=True,
|
||||
states={
|
||||
'readonly': Eval('code_readonly', True),
|
||||
},
|
||||
depends=['code_readonly'])
|
||||
code_readonly = fields.Function(fields.Boolean('Code Readonly'),
|
||||
'get_code_readonly')
|
||||
party = fields.Many2One('party.party', 'Party', required=True)
|
||||
milestone_group = fields.One2One(
|
||||
'asset.project-account.invoice.milestone.group',
|
||||
'project', 'milestone_group', 'Milestone Group',
|
||||
domain=[
|
||||
('party', '=', Eval('party')),
|
||||
('company', '=', Eval('company')),
|
||||
],
|
||||
states={
|
||||
'readonly': (Eval('id', 0) > 0) & Bool(Eval('milestone_group', 0)),
|
||||
},
|
||||
depends=['id', 'party', 'company'])
|
||||
milestones = fields.Function(fields.One2Many('account.invoice.milestone',
|
||||
None, 'Milestones',
|
||||
domain=[
|
||||
('group', '=', Eval('milestone_group')),
|
||||
],
|
||||
depends=['milestone_group']),
|
||||
'get_milestones', setter='set_milestones')
|
||||
asset = fields.Many2One('asset', 'Asset', required=True,
|
||||
select=True)
|
||||
start_date = fields.Date('Start Date',
|
||||
states={
|
||||
'invisible': Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance'])
|
||||
end_date = fields.Date('End Date',
|
||||
states={
|
||||
'invisible': Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance'])
|
||||
maintenance = fields.Boolean('Maintenance')
|
||||
asset_maintenances = fields.One2Many('asset.maintenance', 'reference',
|
||||
'Maintenances', size=1)
|
||||
category = fields.Function(fields.Many2One('asset.maintenance.category',
|
||||
'Category',
|
||||
states={
|
||||
'required': Bool(Eval('maintenance')),
|
||||
'invisible': ~Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance']),
|
||||
'get_maintenance', setter='set_maintenance',
|
||||
searcher='search_maintenance')
|
||||
date_planned = fields.Function(fields.Date('Planned Date',
|
||||
states={
|
||||
'invisible': ~Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance']),
|
||||
'get_maintenance', setter='set_maintenance',
|
||||
searcher='search_maintenance')
|
||||
date_start = fields.Function(fields.Date('Start Date',
|
||||
states={
|
||||
'invisible': ~Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance']),
|
||||
'get_maintenance', setter='set_maintenance',
|
||||
searcher='search_maintenance')
|
||||
date_done = fields.Function(fields.Date('Done Date',
|
||||
states={
|
||||
'invisible': ~Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance']),
|
||||
'get_maintenance', setter='set_maintenance',
|
||||
searcher='search_maintenance')
|
||||
date_next = fields.Function(fields.Date('Next maintenance',
|
||||
states={
|
||||
'invisible': ~Bool(Eval('maintenance')),
|
||||
},
|
||||
depends=['maintenance']),
|
||||
'get_maintenance', setter='set_maintenance',
|
||||
searcher='search_maintenance')
|
||||
|
||||
work_shipments = fields.One2Many('shipment.work', 'project',
|
||||
'Shipment Works',
|
||||
domain=[
|
||||
('party', '=', Eval('party')),
|
||||
],
|
||||
depends=['party'])
|
||||
sales = fields.One2Many('sale.sale', 'project', 'Sales',
|
||||
domain=[
|
||||
('party', '=', Eval('party', -1)),
|
||||
],
|
||||
add_remove=[
|
||||
('state', 'in', ['quotation', 'confirmed', 'processing']),
|
||||
],
|
||||
depends=['party'])
|
||||
sale_lines = fields.One2Many('asset.project.sale.line', 'project',
|
||||
'Sale Lines')
|
||||
amount_invoice = fields.Function(fields.Numeric('Amount To Invoice',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_amount_milestones')
|
||||
amount_milestones = fields.Function(fields.Numeric('Amount In Milestones',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_amount_milestones')
|
||||
amount_to_assign = fields.Function(fields.Numeric('Amount to Assign',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_amount_milestones')
|
||||
shipments = fields.Function(fields.One2Many('stock.shipment.out',
|
||||
None, 'Shipments'), 'get_shipments')
|
||||
shipment_returns = fields.Function(fields.One2Many(
|
||||
'stock.shipment.out.return', None, 'Shipment Returns'),
|
||||
'get_shipment_returns')
|
||||
moves = fields.Function(fields.One2Many('stock.move', None, 'Moves'),
|
||||
'get_moves')
|
||||
income_labor = fields.Function(fields.Numeric('Income Labor',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_income_labor')
|
||||
income_material = fields.Function(fields.Numeric('Income Material',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_income_material')
|
||||
income_other = fields.Function(fields.Numeric('Income Other',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_income_other')
|
||||
expense_labor = fields.Function(fields.Numeric('Expense Labor',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_expense_labor')
|
||||
expense_material = fields.Function(fields.Numeric('Expense Material',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_expense_material')
|
||||
expense_other = fields.Function(fields.Numeric('Expense Other',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_expense_other')
|
||||
margin_labor = fields.Function(fields.Numeric('Margin Labor',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_margins')
|
||||
margin_material = fields.Function(fields.Numeric('Margin Material',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_margins')
|
||||
margin_other = fields.Function(fields.Numeric('Margin Other',
|
||||
digits=(16, Eval('unit_digits', 2)),
|
||||
depends=['unit_digits']),
|
||||
'get_margins')
|
||||
margin_percent_labor = fields.Function(fields.Numeric('Margin(%) Labor',
|
||||
digits=(16, 4)),
|
||||
'get_margins')
|
||||
margin_percent_material = fields.Function(fields.Numeric(
|
||||
'Margin (%) Material', digits=(16, 4)),
|
||||
'get_margins')
|
||||
margin_percent_other = fields.Function(fields.Numeric('Margin (%) Other',
|
||||
digits=(16, 4)),
|
||||
'get_margins')
|
||||
note = fields.Text('Note')
|
||||
|
||||
@staticmethod
|
||||
def default_currency_digits():
|
||||
Company = Pool().get('company.company')
|
||||
if Transaction().context.get('company'):
|
||||
company = Company(Transaction().context['company'])
|
||||
return company.currency.digits
|
||||
return 2
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
|
||||
@staticmethod
|
||||
def default_code_readonly():
|
||||
Configuration = Pool().get('asset.project.configuration')
|
||||
config = Configuration(1)
|
||||
return bool(config.project_sequence)
|
||||
|
||||
@fields.depends('company')
|
||||
def on_change_with_unit_digits(self, name=None):
|
||||
if self.company:
|
||||
return self.company.currency.digits
|
||||
return 2
|
||||
|
||||
@classmethod
|
||||
def get_amount_milestones(self, projects, names):
|
||||
res = {}
|
||||
for name in names:
|
||||
res[name] = dict((p.id, _ZERO) for p in projects)
|
||||
for project in projects:
|
||||
skip = set()
|
||||
for sale in project.sales:
|
||||
if not sale.milestone_group or sale.milestone_group.id in skip:
|
||||
continue
|
||||
for name, field in [
|
||||
('amount_milestones', 'amount'),
|
||||
('amount_to_assign', 'amount_to_assign'),
|
||||
]:
|
||||
if name in names:
|
||||
res[name][project.id] += getattr(
|
||||
sale.milestone_group, field, _ZERO)
|
||||
if 'amount_invoiced' in names:
|
||||
res[name][project.id] += (sale.milestone_group.amount -
|
||||
sale.milestone_group.amount_invoiced)
|
||||
skip.add(sale.milestone_group.id)
|
||||
return res
|
||||
|
||||
def get_income_labor(self, name):
|
||||
amount = _ZERO
|
||||
for sale in self.sales:
|
||||
for line in sale.lines:
|
||||
if line.product and line.product.type == 'service':
|
||||
amount += line.amount
|
||||
return amount
|
||||
|
||||
def get_income_material(self, name):
|
||||
amount = _ZERO
|
||||
for sale in self.sales:
|
||||
for line in sale.lines:
|
||||
if line.product and line.product.type != 'service':
|
||||
amount += line.amount
|
||||
return amount
|
||||
|
||||
def get_income_other(self, name):
|
||||
amount = _ZERO
|
||||
for sale in self.sales:
|
||||
for line in sale.lines:
|
||||
if not line.product:
|
||||
amount += line.amount
|
||||
return amount
|
||||
|
||||
def get_expense_labor(self, name):
|
||||
amount = _ZERO
|
||||
for shipment_work in self.work_shipments:
|
||||
for line in shipment_work.timesheet_lines:
|
||||
amount += line.compute_cost()
|
||||
return amount
|
||||
|
||||
def get_expense_material(self, name):
|
||||
amount = _ZERO
|
||||
for sale in self.sales:
|
||||
for line in sale.lines:
|
||||
if line.product and line.product.type != 'service':
|
||||
# Compatibility with sale_margin
|
||||
if hasattr(line, 'cost_price'):
|
||||
amount += sale.currency.round(
|
||||
Decimal(str(line.quantity)) * line.cost_price)
|
||||
else:
|
||||
amount += sale.currency.round(line.product.cost_price *
|
||||
Decimal(str(line.quantity)))
|
||||
return amount
|
||||
|
||||
def get_expense_other(self, name):
|
||||
amount = _ZERO
|
||||
return amount
|
||||
|
||||
@classmethod
|
||||
def get_margins(cls, projects, names):
|
||||
res = {}
|
||||
for name in names:
|
||||
res[name] = dict((p.id, _ZERO) for p in projects)
|
||||
for project in projects:
|
||||
for name in names:
|
||||
field_name = name.split('_')[-1]
|
||||
income = getattr(project, 'income_%s' % field_name)
|
||||
expense = getattr(project, 'expense_%s' % field_name)
|
||||
if 'percent' in name:
|
||||
if not expense:
|
||||
value = Decimal('1.0')
|
||||
else:
|
||||
value = (income - expense) / expense
|
||||
else:
|
||||
value = income - expense
|
||||
res[name][project.id] = value
|
||||
return res
|
||||
|
||||
def get_code_readonly(self, name):
|
||||
return True
|
||||
|
||||
def get_moves(self, name):
|
||||
return [m.id for s in self.sales for m in s.moves]
|
||||
|
||||
def get_shipments(self, name):
|
||||
return [m.id for s in self.sales for m in s.shipments]
|
||||
|
||||
def get_shipment_returns(self, name):
|
||||
return [m.id for s in self.sales for m in s.shipment_returns]
|
||||
|
||||
@classmethod
|
||||
def get_maintenance(cls, projects, names):
|
||||
pool = Pool()
|
||||
Maintenance = pool.get('asset.maintenance')
|
||||
res = {}
|
||||
for name in names:
|
||||
res[name] = dict((m.id, None) for m in projects)
|
||||
|
||||
for maintenance in Maintenance.search([
|
||||
('reference', 'in', [str(m) for m in projects]),
|
||||
]):
|
||||
project = maintenance.reference.id
|
||||
for name in names:
|
||||
value = getattr(maintenance, name)
|
||||
if isinstance(value, ModelSQL):
|
||||
value = value.id
|
||||
res[name][project] = value
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
def set_maintenance(cls, projects, name, value):
|
||||
pool = Pool()
|
||||
Maintenance = pool.get('asset.maintenance')
|
||||
to_write = []
|
||||
to_create = []
|
||||
for project in projects:
|
||||
if not project.maintenance:
|
||||
continue
|
||||
if not project.asset_maintenances:
|
||||
to_create.append(project.asset_maintenance_vals(
|
||||
{name: value}))
|
||||
else:
|
||||
to_write.extend(project.asset_maintenances)
|
||||
if to_create:
|
||||
Maintenance.create(to_create)
|
||||
if to_write:
|
||||
Maintenance.write(to_write, {
|
||||
name: value,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def search_maintenance(cls, name, clause):
|
||||
return [('projects.%s' % name,) + tuple(clause[1:])]
|
||||
|
||||
def asset_maintenance_vals(self, vals):
|
||||
'Returns the values for the asset maintenance to be created for self'
|
||||
vals['reference'] = str(self)
|
||||
vals['asset'] = self.asset.id
|
||||
return vals
|
||||
|
||||
def get_milestones(self, name=None):
|
||||
return [m.id for m in self.milestone_group.lines]
|
||||
|
||||
@classmethod
|
||||
def set_milestones(cls, projects, name, value):
|
||||
pool = Pool()
|
||||
MilestoneGroup = pool.get('account.invoice.milestone.group')
|
||||
groups = [p.milestone_group for p in projects if p.milestone_group]
|
||||
if groups:
|
||||
MilestoneGroup.write(groups, {
|
||||
'lines': value,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
'Fill the reference field with the sale sequence'
|
||||
pool = Pool()
|
||||
Sequence = pool.get('ir.sequence')
|
||||
MilestoneGroup = pool.get('account.invoice.milestone.group')
|
||||
Config = pool.get('asset.project.configuration')
|
||||
|
||||
config = Config(1)
|
||||
for value in vlist:
|
||||
if not value.get('code'):
|
||||
code = Sequence.get_id(config.project_sequence.id)
|
||||
value['code'] = code
|
||||
if not value.get('milestone_group'):
|
||||
vals = {'party': value.get('party')}
|
||||
group, = MilestoneGroup.create([vals])
|
||||
value['milestone_group'] = group.id
|
||||
return super(Project, cls).create(vlist)
|
||||
|
||||
|
||||
class ShipmentWork:
|
||||
__name__ = 'shipment.work'
|
||||
project = fields.Many2One('asset.project', 'Project',
|
||||
states={
|
||||
'readonly': Eval('state').in_(['checked', 'cancel']),
|
||||
},
|
||||
depends=['state'])
|
||||
|
||||
|
||||
class Sale:
|
||||
__name__ = 'sale.sale'
|
||||
project = fields.Many2One('asset.project', 'Project',
|
||||
domain=[
|
||||
('party', '=', Eval('party')),
|
||||
],
|
||||
depends=['party'])
|
||||
|
||||
@classmethod
|
||||
def _ensure_milestone_project_relation(cls, sales):
|
||||
to_write = []
|
||||
for sale in sales:
|
||||
if (sale.project and (not sale.milestone_group or
|
||||
sale.milestone_group != sale.project.milestone_group)):
|
||||
to_write.extend(([sale], {
|
||||
'milestone_group': sale.project.milestone_group.id,
|
||||
}))
|
||||
if to_write:
|
||||
cls.write(*to_write)
|
||||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
sales = super(Sale, cls).create(vlist)
|
||||
cls._ensure_milestone_project_relation(sales)
|
||||
return sales
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
actions = iter(args)
|
||||
all_sales = []
|
||||
for sales, _ in zip(actions, actions):
|
||||
all_sales += sales
|
||||
super(Sale, cls).write(*args)
|
||||
cls._ensure_milestone_project_relation(all_sales)
|
||||
|
||||
|
||||
class Maintenance:
|
||||
__name__ = 'asset.maintenance'
|
||||
|
||||
@classmethod
|
||||
def _get_reference(cls):
|
||||
references = super(Maintenance, cls)._get_reference()
|
||||
references.append('asset.project')
|
||||
return references
|
||||
|
||||
|
||||
class MilestoneGroup:
|
||||
__name__ = 'account.invoice.milestone.group'
|
||||
#TODO: Add this to the views
|
||||
project = fields.One2One('asset.project-account.invoice.milestone.group',
|
||||
'milestone_group', 'project', 'Project', readonly=True,
|
||||
domain=[
|
||||
('party', '=', Eval('party')),
|
||||
('company', '=', Eval('company')),
|
||||
],
|
||||
depends=['party', 'company'])
|
|
@ -0,0 +1,190 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
|
||||
<record model="res.group" id="group_asset_project_admin">
|
||||
<field name="name">Asset Project Administration</field>
|
||||
</record>
|
||||
<record model="res.user-res.group" id="user_admin_group_asset_project_admin">
|
||||
<field name="user" ref="res.user_admin"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
<record model="res.user-res.group" id="user_trigger_group_asset_project_admin">
|
||||
<field name="user" ref="res.user_trigger"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
<record model="res.group" id="group_asset_project">
|
||||
<field name="name">Asset Project</field>
|
||||
</record>
|
||||
<record model="res.user-res.group" id="user_admin_group_asset_project">
|
||||
<field name="user" ref="res.user_admin"/>
|
||||
<field name="group" ref="group_asset_project"/>
|
||||
</record>
|
||||
<record model="res.user-res.group" id="user_trigger_group_asset_project">
|
||||
<field name="user" ref="res.user_trigger"/>
|
||||
<field name="group" ref="group_asset_project"/>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="asset_project_view_form">
|
||||
<field name="model">asset.project</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">project_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="asset_project_view_list">
|
||||
<field name="model">asset.project</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">project_list</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_asset_project">
|
||||
<field name="name">Asset Project</field>
|
||||
<field name="res_model">asset.project</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_asset_project_view1">
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="view" ref="asset_project_view_list"/>
|
||||
<field name="act_window" ref="act_asset_project"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_asset_project_view2">
|
||||
<field name="sequence" eval="20"/>
|
||||
<field name="view" ref="asset_project_view_form"/>
|
||||
<field name="act_window" ref="act_asset_project"/>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_asset_project">
|
||||
<field name="model" search="[('model', '=', 'asset.project')]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_asset_project_user">
|
||||
<field name="model" search="[('model', '=', 'asset.project')]"/>
|
||||
<field name="group" ref="group_asset_project"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_delete" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_asset_project_admin">
|
||||
<field name="model" search="[('model', '=', 'asset.project')]"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_delete" eval="True"/>
|
||||
</record>
|
||||
<!-- Relates -->
|
||||
<record model="ir.action.act_window" id="act_shipment_form">
|
||||
<field name="name">Shipments</field>
|
||||
<field name="res_model">stock.shipment.out</field>
|
||||
<field name="domain">[('moves.sale.project', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_open_shipment_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">asset.project,-1</field>
|
||||
<field name="action" ref="act_shipment_form"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_return_form">
|
||||
<field name="name">Returns</field>
|
||||
<field name="res_model">stock.shipment.out.return</field>
|
||||
<field name="domain">[('moves.sale.project', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="act_open_shipment_return_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">asset.project,-1</field>
|
||||
<field name="action" ref="act_return_form"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_shipment_work_form">
|
||||
<field name="name">Shipment Work</field>
|
||||
<field name="res_model">shipment.work</field>
|
||||
<field name="domain">[('project', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_open_shipment_work_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">asset.project,-1</field>
|
||||
<field name="action" ref="act_shipment_work_form"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_timesheet_lines_form">
|
||||
<field name="name">Timesheet Lines</field>
|
||||
<field name="res_model">timesheet.line</field>
|
||||
<field name="domain">[('shipment.project', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_open_timesheet_lines_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">asset.project,-1</field>
|
||||
<field name="action" ref="act_timesheet_lines_form"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_invoices_form">
|
||||
<field name="name">Invoices</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="domain">[('milestone.group.project', 'in', Eval('active_ids'))]</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_open_invoices_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">asset.project,-1</field>
|
||||
<field name="action" ref="act_invoices_form"/>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="project_sale_line_view_form">
|
||||
<field name="model">asset.project.sale.line</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">project_sale_line_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="project_sale_line_view_tree">
|
||||
<field name="model">asset.project.sale.line</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">project_sale_line_tree</field>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_asset_project_sale_line">
|
||||
<field name="model"
|
||||
search="[('model', '=', 'asset.project.sale.line')]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sale_sale_view_form">
|
||||
<field name="model">sale.sale</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="sale.sale_view_form"/>
|
||||
<field name="name">sale_sale_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="shipment_work_view_form">
|
||||
<field name="model">shipment.work</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="shipment_work.shipment_work_view_form"/>
|
||||
<field name="name">shipment_work_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="shipment_work_view_list">
|
||||
<field name="model">shipment.work</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit" ref="shipment_work.shipment_work_view_list"/>
|
||||
<field name="name">shipment_work_list</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule.group" id="rule_group_asset_project">
|
||||
<field name="model" search="[('model', '=', 'asset.project')]"/>
|
||||
<field name="global_p" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="rule_asset_project1">
|
||||
<field name="domain">[('company', '=', user.company.id if user.company else None)]</field>
|
||||
<field name="rule_group" ref="rule_group_asset_project"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="act_asset_project" id="menu_asset_project"
|
||||
parent="asset.menu_asset" sequence="20"/>
|
||||
<record model="ir.ui.menu-res.group" id="menu_asset_project_group_admin">
|
||||
<field name="menu" ref="menu_asset_project"/>
|
||||
<field name="group" ref="group_asset_project"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.menu-res.group" id="menu_asset_project_group_asset_project_admin">
|
||||
<field name="menu" ref="menu_asset_project"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
|
@ -0,0 +1,72 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.model import Model, ModelSQL, ModelView, ModelSingleton, fields
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
__all__ = ['Configuration', 'ConfigurationCompany']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
'Project Configuration'
|
||||
__name__ = 'asset.project.configuration'
|
||||
project_sequence = fields.Function(fields.Many2One(
|
||||
'ir.sequence', 'Maintenance Sequence',
|
||||
domain=[
|
||||
('company', 'in',
|
||||
[Eval('context', {}).get('company', -1), None]),
|
||||
('code', '=', 'asset.project'),
|
||||
]), 'get_company_config', setter='set_company_config')
|
||||
|
||||
@classmethod
|
||||
def get_company_config(self, configs, names):
|
||||
pool = Pool()
|
||||
CompanyConfig = pool.get('asset.project.configuration.company')
|
||||
|
||||
company_id = Transaction().context.get('company')
|
||||
company_configs = CompanyConfig.search([
|
||||
('company', '=', company_id),
|
||||
])
|
||||
|
||||
res = {}
|
||||
for fname in names:
|
||||
res[fname] = {
|
||||
configs[0].id: None,
|
||||
}
|
||||
if company_configs:
|
||||
val = getattr(company_configs[0], fname)
|
||||
if isinstance(val, Model):
|
||||
val = val.id
|
||||
res[fname][configs[0].id] = val
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
def set_company_config(self, configs, name, value):
|
||||
pool = Pool()
|
||||
CompanyConfig = pool.get('asset.project.configuration.company')
|
||||
|
||||
company_id = Transaction().context.get('company')
|
||||
company_configs = CompanyConfig.search([
|
||||
('company', '=', company_id),
|
||||
])
|
||||
if company_configs:
|
||||
company_config = company_configs[0]
|
||||
else:
|
||||
company_config = CompanyConfig(company=company_id)
|
||||
setattr(company_config, name, value)
|
||||
company_config.save()
|
||||
|
||||
|
||||
class ConfigurationCompany(ModelSQL):
|
||||
'Asset Project Configuration per Company'
|
||||
__name__ = 'asset.project.configuration.company'
|
||||
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
ondelete='CASCADE', select=True)
|
||||
project_sequence = fields.Many2One('ir.sequence',
|
||||
'Project Sequence',
|
||||
domain=[
|
||||
('code', '=', 'asset.project'),
|
||||
])
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="configuration_view_form">
|
||||
<field name="model">asset.project.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">configuration_form</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_configuration_form">
|
||||
<field name="name">Project Configuration</field>
|
||||
<field name="res_model">asset.project.configuration</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_configuration_view1">
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="view" ref="configuration_view_form"/>
|
||||
<field name="act_window" ref="act_configuration_form"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence.type" id="sequence_type_asset_project">
|
||||
<field name="name">Asset Project</field>
|
||||
<field name="code">asset.project</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type-res.group"
|
||||
id="sequence_type_asset_project_group_admin">
|
||||
<field name="sequence_type" ref="sequence_type_asset_project"/>
|
||||
<field name="group" ref="res.group_admin"/>
|
||||
</record>
|
||||
<record model="ir.sequence.type-res.group"
|
||||
id="sequence_type_asset_project_group_sale_admin">
|
||||
<field name="sequence_type" ref="sequence_type_asset_project"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="sequence_asset_project">
|
||||
<field name="name">Asset Project</field>
|
||||
<field name="code">asset.project</field>
|
||||
</record>
|
||||
<!-- Menus -->
|
||||
|
||||
<menuitem action="act_configuration_form"
|
||||
id="menu_configuration_form" parent="asset.menu_configuration"
|
||||
sequence="10"/>
|
||||
|
||||
<record model="ir.ui.menu-res.group" id="menu_configuration_group_admin">
|
||||
<field name="menu" ref="menu_configuration_form"/>
|
||||
<field name="group" ref="res.group_admin"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.menu-res.group"
|
||||
id="menu_configuration_group_asset_project_admin">
|
||||
<field name="menu" ref="menu_configuration_form"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
<record model="ir.ui.menu-res.group"
|
||||
id="menu_asset_configuration_group_asset_project_admin">
|
||||
<field name="menu" ref="asset.menu_configuration"/>
|
||||
<field name="group" ref="group_asset_project_admin"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</tryton>
|
|
@ -0,0 +1,471 @@
|
|||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "error:asset.project-account.invoice.milestone.group:"
|
||||
msgid "The Milestone Group must be unique."
|
||||
msgstr "El grup de fites ha de ser únic."
|
||||
|
||||
msgctxt "error:asset.project-account.invoice.milestone.group:"
|
||||
msgid "The Project must be unique."
|
||||
msgstr "El projecte ha de ser únic."
|
||||
|
||||
msgctxt "field:account.invoice.milestone.group,project:"
|
||||
msgid "Project"
|
||||
msgstr "Projecte"
|
||||
|
||||
msgctxt "field:asset.project,amount_invoice:"
|
||||
msgid "Amount To Invoice"
|
||||
msgstr "Import per facturar"
|
||||
|
||||
msgctxt "field:asset.project,amount_milestones:"
|
||||
msgid "Amount In Milestones"
|
||||
msgstr "Import en fites"
|
||||
|
||||
msgctxt "field:asset.project,amount_to_assign:"
|
||||
msgid "Amount to Assign"
|
||||
msgstr "Import per assignar"
|
||||
|
||||
msgctxt "field:asset.project,asset:"
|
||||
msgid "Asset"
|
||||
msgstr "Actiu"
|
||||
|
||||
msgctxt "field:asset.project,asset_maintenances:"
|
||||
msgid "Maintenances"
|
||||
msgstr "Manteniments"
|
||||
|
||||
msgctxt "field:asset.project,category:"
|
||||
msgid "Category"
|
||||
msgstr "Categoría"
|
||||
|
||||
msgctxt "field:asset.project,code:"
|
||||
msgid "Code"
|
||||
msgstr "Codi"
|
||||
|
||||
msgctxt "field:asset.project,code_readonly:"
|
||||
msgid "Code Readonly"
|
||||
msgstr "Codi només lectura"
|
||||
|
||||
msgctxt "field:asset.project,company:"
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
msgctxt "field:asset.project,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Data de creació"
|
||||
|
||||
msgctxt "field:asset.project,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuari de creació"
|
||||
|
||||
msgctxt "field:asset.project,date_done:"
|
||||
msgid "Done Date"
|
||||
msgstr "Data realizació"
|
||||
|
||||
msgctxt "field:asset.project,date_next:"
|
||||
msgid "Next maintenance"
|
||||
msgstr "Pròxim manteniment"
|
||||
|
||||
msgctxt "field:asset.project,date_planned:"
|
||||
msgid "Planned Date"
|
||||
msgstr "Data planificada"
|
||||
|
||||
msgctxt "field:asset.project,date_start:"
|
||||
msgid "Start Date"
|
||||
msgstr "Data inicial"
|
||||
|
||||
msgctxt "field:asset.project,end_date:"
|
||||
msgid "End Date"
|
||||
msgstr "Data finalització"
|
||||
|
||||
msgctxt "field:asset.project,expense_labor:"
|
||||
msgid "Expense Labor"
|
||||
msgstr "Despeses laborals"
|
||||
|
||||
msgctxt "field:asset.project,expense_material:"
|
||||
msgid "Expense Material"
|
||||
msgstr "Despeses materials"
|
||||
|
||||
msgctxt "field:asset.project,expense_other:"
|
||||
msgid "Expense Other"
|
||||
msgstr "Altres despeses"
|
||||
|
||||
msgctxt "field:asset.project,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project,income_labor:"
|
||||
msgid "Income Labor"
|
||||
msgstr "Ingressos laborals"
|
||||
|
||||
msgctxt "field:asset.project,income_material:"
|
||||
msgid "Income Material"
|
||||
msgstr "Ingressos materials"
|
||||
|
||||
msgctxt "field:asset.project,income_other:"
|
||||
msgid "Income Other"
|
||||
msgstr "Altres ingressos"
|
||||
|
||||
msgctxt "field:asset.project,maintenance:"
|
||||
msgid "Maintenance"
|
||||
msgstr "Manteniment"
|
||||
|
||||
msgctxt "field:asset.project,margin_labor:"
|
||||
msgid "Margin Labor"
|
||||
msgstr "Marge Laboral"
|
||||
|
||||
msgctxt "field:asset.project,margin_material:"
|
||||
msgid "Margin Material"
|
||||
msgstr "Marge material"
|
||||
|
||||
msgctxt "field:asset.project,margin_other:"
|
||||
msgid "Margin Other"
|
||||
msgstr "Marge altres"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_labor:"
|
||||
msgid "Margin(%) Labor"
|
||||
msgstr "Marge (%) Laboral"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_material:"
|
||||
msgid "Margin (%) Material"
|
||||
msgstr "Marge (%) material"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_other:"
|
||||
msgid "Margin (%) Other"
|
||||
msgstr "Marge (%) altres"
|
||||
|
||||
msgctxt "field:asset.project,milestone_group:"
|
||||
msgid "Milestone Group"
|
||||
msgstr "Grup de fites"
|
||||
|
||||
msgctxt "field:asset.project,milestones:"
|
||||
msgid "Milestones"
|
||||
msgstr "Fites"
|
||||
|
||||
msgctxt "field:asset.project,moves:"
|
||||
msgid "Moves"
|
||||
msgstr "Moviments"
|
||||
|
||||
msgctxt "field:asset.project,note:"
|
||||
msgid "Note"
|
||||
msgstr "Nota"
|
||||
|
||||
msgctxt "field:asset.project,party:"
|
||||
msgid "Party"
|
||||
msgstr "Tercers"
|
||||
|
||||
msgctxt "field:asset.project,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgctxt "field:asset.project,sale_lines:"
|
||||
msgid "Sale Lines"
|
||||
msgstr "Línies de venda"
|
||||
|
||||
msgctxt "field:asset.project,sales:"
|
||||
msgid "Sales"
|
||||
msgstr "Vendes"
|
||||
|
||||
msgctxt "field:asset.project,shipment_returns:"
|
||||
msgid "Shipment Returns"
|
||||
msgstr "Albarans de devolució"
|
||||
|
||||
msgctxt "field:asset.project,shipments:"
|
||||
msgid "Shipments"
|
||||
msgstr "Albarans"
|
||||
|
||||
msgctxt "field:asset.project,start_date:"
|
||||
msgid "Start Date"
|
||||
msgstr "Data inicial"
|
||||
|
||||
msgctxt "field:asset.project,unit_digits:"
|
||||
msgid "Unit Digits"
|
||||
msgstr "Decimals unitaris"
|
||||
|
||||
msgctxt "field:asset.project,work_shipments:"
|
||||
msgid "Shipment Works"
|
||||
msgstr "Albarans de treball"
|
||||
|
||||
msgctxt "field:asset.project,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Data modificación"
|
||||
|
||||
msgctxt "field:asset.project,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuari modificació"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Data de creació"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuari de creació"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,milestone_group:"
|
||||
msgid "Milestone Group"
|
||||
msgstr "Grup de fites"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,project:"
|
||||
msgid "Project"
|
||||
msgstr "Projecte"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Data modificación"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuari modificació"
|
||||
|
||||
msgctxt "field:asset.project.configuration,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Data de creació"
|
||||
|
||||
msgctxt "field:asset.project.configuration,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuari de creació"
|
||||
|
||||
msgctxt "field:asset.project.configuration,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.configuration,project_sequence:"
|
||||
msgid "Maintenance Sequence"
|
||||
msgstr "Seqüencia manteniments"
|
||||
|
||||
msgctxt "field:asset.project.configuration,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgctxt "field:asset.project.configuration,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Data modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuari modificació"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,company:"
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Data de creació"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuari de creació"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,project_sequence:"
|
||||
msgid "Project Sequence"
|
||||
msgstr "Seqüencia projectes"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Data modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuari modificació"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,amount:"
|
||||
msgid "Amount"
|
||||
msgstr "Quantitat"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Data de creació"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuari de creació"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,currency:"
|
||||
msgid "Currency"
|
||||
msgstr "Moneda"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,currency_digits:"
|
||||
msgid "Currency Digits"
|
||||
msgstr "Dígits de la moneda"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,product:"
|
||||
msgid "Product"
|
||||
msgstr "Productes"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,project:"
|
||||
msgid "Project"
|
||||
msgstr "Projecte"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,quantity:"
|
||||
msgid "Quantity"
|
||||
msgstr "Quantitat"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit:"
|
||||
msgid "Unit"
|
||||
msgstr "Unitat"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit_digits:"
|
||||
msgid "Unit Digits"
|
||||
msgstr "Decimals unitaris"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit_price:"
|
||||
msgid "Unit Price"
|
||||
msgstr "Preu unitat"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Data modificación"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuari modificació"
|
||||
|
||||
msgctxt "field:sale.sale,project:"
|
||||
msgid "Project"
|
||||
msgstr "Projecte"
|
||||
|
||||
msgctxt "field:shipment.work,project:"
|
||||
msgid "Project"
|
||||
msgstr "Projecte"
|
||||
|
||||
msgctxt "model:asset.project,name:"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projecte d'actiu"
|
||||
|
||||
msgctxt "model:asset.project-account.invoice.milestone.group,name:"
|
||||
msgid "Project - Milestone"
|
||||
msgstr "Projecte - Fita"
|
||||
|
||||
msgctxt "model:asset.project.configuration,name:"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuració projectes"
|
||||
|
||||
msgctxt "model:asset.project.configuration.company,name:"
|
||||
msgid "Asset Project Configuration per Company"
|
||||
msgstr "Configuració de projectes d'actius per empresa"
|
||||
|
||||
msgctxt "model:asset.project.sale.line,name:"
|
||||
msgid "Project Sale Line"
|
||||
msgstr "Línia de venda de projecte"
|
||||
|
||||
msgctxt "model:ir.action,name:act_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projecte d'actiu"
|
||||
|
||||
msgctxt "model:ir.action,name:act_configuration_form"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuració projectes"
|
||||
|
||||
msgctxt "model:ir.action,name:act_invoices_form"
|
||||
msgid "Invoices"
|
||||
msgstr "Factures"
|
||||
|
||||
msgctxt "model:ir.action,name:act_return_form"
|
||||
msgid "Returns"
|
||||
msgstr "Albarans devolució"
|
||||
|
||||
msgctxt "model:ir.action,name:act_shipment_form"
|
||||
msgid "Shipments"
|
||||
msgstr "Albarans"
|
||||
|
||||
msgctxt "model:ir.action,name:act_shipment_work_form"
|
||||
msgid "Shipment Work"
|
||||
msgstr "Albarans de treball"
|
||||
|
||||
msgctxt "model:ir.action,name:act_timesheet_lines_form"
|
||||
msgid "Timesheet Lines"
|
||||
msgstr "Línies del full de treball"
|
||||
|
||||
msgctxt "model:ir.sequence,name:sequence_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projecte d'actiu"
|
||||
|
||||
msgctxt "model:ir.sequence.type,name:sequence_type_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projectes d'actius"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projectes d'actius"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_configuration_form"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuració projectes"
|
||||
|
||||
msgctxt "model:res.group,name:group_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projectes d'actius"
|
||||
|
||||
msgctxt "model:res.group,name:group_asset_project_admin"
|
||||
msgid "Asset Project Administration"
|
||||
msgstr "Administració de projectes d'actius"
|
||||
|
||||
msgctxt "view:asset.project.configuration:"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuració projectes"
|
||||
|
||||
msgctxt "view:asset.project.sale.line:"
|
||||
msgid "Project Sale Line"
|
||||
msgstr "Línia de venda de projecte"
|
||||
|
||||
msgctxt "view:asset.project.sale.line:"
|
||||
msgid "Project Sale lines"
|
||||
msgstr "Línia de venda de projecte"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Amounts"
|
||||
msgstr "Imports"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Asset Project"
|
||||
msgstr "Projecte d'actiu"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Asset Projects"
|
||||
msgstr "Projectes d'actius"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Expense"
|
||||
msgstr "Despesa"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Income"
|
||||
msgstr "Ingressos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Invoice"
|
||||
msgstr "Factura"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Margins"
|
||||
msgstr "Marges"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Shipments"
|
||||
msgstr "Albarans"
|
|
@ -0,0 +1,471 @@
|
|||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "error:asset.project-account.invoice.milestone.group:"
|
||||
msgid "The Milestone Group must be unique."
|
||||
msgstr "El grupo de fitas debe ser único."
|
||||
|
||||
msgctxt "error:asset.project-account.invoice.milestone.group:"
|
||||
msgid "The Project must be unique."
|
||||
msgstr "El proyecto debe ser único."
|
||||
|
||||
msgctxt "field:account.invoice.milestone.group,project:"
|
||||
msgid "Project"
|
||||
msgstr "Proyecto"
|
||||
|
||||
msgctxt "field:asset.project,amount_invoice:"
|
||||
msgid "Amount To Invoice"
|
||||
msgstr "Importe a facturar"
|
||||
|
||||
msgctxt "field:asset.project,amount_milestones:"
|
||||
msgid "Amount In Milestones"
|
||||
msgstr "Importe en hitos"
|
||||
|
||||
msgctxt "field:asset.project,amount_to_assign:"
|
||||
msgid "Amount to Assign"
|
||||
msgstr "Importe por asignar"
|
||||
|
||||
msgctxt "field:asset.project,asset:"
|
||||
msgid "Asset"
|
||||
msgstr "Activos"
|
||||
|
||||
msgctxt "field:asset.project,asset_maintenances:"
|
||||
msgid "Maintenances"
|
||||
msgstr "Mantenimentos"
|
||||
|
||||
msgctxt "field:asset.project,category:"
|
||||
msgid "Category"
|
||||
msgstr "Categoría"
|
||||
|
||||
msgctxt "field:asset.project,code:"
|
||||
msgid "Code"
|
||||
msgstr "Código"
|
||||
|
||||
msgctxt "field:asset.project,code_readonly:"
|
||||
msgid "Code Readonly"
|
||||
msgstr "Código sólo lectura"
|
||||
|
||||
msgctxt "field:asset.project,company:"
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
msgctxt "field:asset.project,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:asset.project,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:asset.project,date_done:"
|
||||
msgid "Done Date"
|
||||
msgstr "Fecha realización"
|
||||
|
||||
msgctxt "field:asset.project,date_next:"
|
||||
msgid "Next maintenance"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:asset.project,date_planned:"
|
||||
msgid "Planned Date"
|
||||
msgstr "Fecha planificación"
|
||||
|
||||
msgctxt "field:asset.project,date_start:"
|
||||
msgid "Start Date"
|
||||
msgstr "Fecha inicio"
|
||||
|
||||
msgctxt "field:asset.project,end_date:"
|
||||
msgid "End Date"
|
||||
msgstr "Fecha finalización"
|
||||
|
||||
msgctxt "field:asset.project,expense_labor:"
|
||||
msgid "Expense Labor"
|
||||
msgstr "Gastos laborales"
|
||||
|
||||
msgctxt "field:asset.project,expense_material:"
|
||||
msgid "Expense Material"
|
||||
msgstr "Gastos materiales"
|
||||
|
||||
msgctxt "field:asset.project,expense_other:"
|
||||
msgid "Expense Other"
|
||||
msgstr "Otros gastos"
|
||||
|
||||
msgctxt "field:asset.project,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project,income_labor:"
|
||||
msgid "Income Labor"
|
||||
msgstr "Ingresos laborales"
|
||||
|
||||
msgctxt "field:asset.project,income_material:"
|
||||
msgid "Income Material"
|
||||
msgstr "Ingresos materiales"
|
||||
|
||||
msgctxt "field:asset.project,income_other:"
|
||||
msgid "Income Other"
|
||||
msgstr "Otros ingresos"
|
||||
|
||||
msgctxt "field:asset.project,maintenance:"
|
||||
msgid "Maintenance"
|
||||
msgstr "Mantenimiento"
|
||||
|
||||
msgctxt "field:asset.project,margin_labor:"
|
||||
msgid "Margin Labor"
|
||||
msgstr "Margen laboral"
|
||||
|
||||
msgctxt "field:asset.project,margin_material:"
|
||||
msgid "Margin Material"
|
||||
msgstr "Margen material"
|
||||
|
||||
msgctxt "field:asset.project,margin_other:"
|
||||
msgid "Margin Other"
|
||||
msgstr "Margen otros"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_labor:"
|
||||
msgid "Margin(%) Labor"
|
||||
msgstr "Margen (%) laboral"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_material:"
|
||||
msgid "Margin (%) Material"
|
||||
msgstr "Margen (%) material"
|
||||
|
||||
msgctxt "field:asset.project,margin_percent_other:"
|
||||
msgid "Margin (%) Other"
|
||||
msgstr "Margen (%) otros"
|
||||
|
||||
msgctxt "field:asset.project,milestone_group:"
|
||||
msgid "Milestone Group"
|
||||
msgstr "Grupo de hitos"
|
||||
|
||||
msgctxt "field:asset.project,milestones:"
|
||||
msgid "Milestones"
|
||||
msgstr "Hitos"
|
||||
|
||||
msgctxt "field:asset.project,moves:"
|
||||
msgid "Moves"
|
||||
msgstr "Movimientos"
|
||||
|
||||
msgctxt "field:asset.project,note:"
|
||||
msgid "Note"
|
||||
msgstr "Nota"
|
||||
|
||||
msgctxt "field:asset.project,party:"
|
||||
msgid "Party"
|
||||
msgstr "Terceros"
|
||||
|
||||
msgctxt "field:asset.project,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:asset.project,sale_lines:"
|
||||
msgid "Sale Lines"
|
||||
msgstr "Líneas de venta"
|
||||
|
||||
msgctxt "field:asset.project,sales:"
|
||||
msgid "Sales"
|
||||
msgstr "Ventas"
|
||||
|
||||
msgctxt "field:asset.project,shipment_returns:"
|
||||
msgid "Shipment Returns"
|
||||
msgstr "Albaranes de devolución"
|
||||
|
||||
msgctxt "field:asset.project,shipments:"
|
||||
msgid "Shipments"
|
||||
msgstr "Albaranes"
|
||||
|
||||
msgctxt "field:asset.project,start_date:"
|
||||
msgid "Start Date"
|
||||
msgstr "Fecha inicio"
|
||||
|
||||
msgctxt "field:asset.project,unit_digits:"
|
||||
msgid "Unit Digits"
|
||||
msgstr "Dígitos unidad"
|
||||
|
||||
msgctxt "field:asset.project,work_shipments:"
|
||||
msgid "Shipment Works"
|
||||
msgstr "Albaranes de trabajo"
|
||||
|
||||
msgctxt "field:asset.project,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:asset.project,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,milestone_group:"
|
||||
msgid "Milestone Group"
|
||||
msgstr "Grupo de hitos"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,project:"
|
||||
msgid "Project"
|
||||
msgstr "Proyecto"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:asset.project-account.invoice.milestone.group,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:asset.project.configuration,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:asset.project.configuration,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.configuration,project_sequence:"
|
||||
msgid "Maintenance Sequence"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:asset.project.configuration,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:asset.project.configuration,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,company:"
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,project_sequence:"
|
||||
msgid "Project Sequence"
|
||||
msgstr "Sequencia proyectos"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:asset.project.configuration.company,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,amount:"
|
||||
msgid "Amount"
|
||||
msgstr "Importe"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,currency:"
|
||||
msgid "Currency"
|
||||
msgstr "Moneda"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,currency_digits:"
|
||||
msgid "Currency Digits"
|
||||
msgstr "Decimals de la moneda"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,product:"
|
||||
msgid "Product"
|
||||
msgstr "Productos"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,project:"
|
||||
msgid "Project"
|
||||
msgstr "Proyecto"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,quantity:"
|
||||
msgid "Quantity"
|
||||
msgstr "Cantidad"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit:"
|
||||
msgid "Unit"
|
||||
msgstr "Unidad"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit_digits:"
|
||||
msgid "Unit Digits"
|
||||
msgstr "Dígitos unidad"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,unit_price:"
|
||||
msgid "Unit Price"
|
||||
msgstr "Precio unidad"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:asset.project.sale.line,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "field:sale.sale,project:"
|
||||
msgid "Project"
|
||||
msgstr "Proyecto"
|
||||
|
||||
msgctxt "field:shipment.work,project:"
|
||||
msgid "Project"
|
||||
msgstr "Proyecto"
|
||||
|
||||
msgctxt "model:asset.project,name:"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyecto de activos"
|
||||
|
||||
msgctxt "model:asset.project-account.invoice.milestone.group,name:"
|
||||
msgid "Project - Milestone"
|
||||
msgstr "Proyecto - Hito"
|
||||
|
||||
msgctxt "model:asset.project.configuration,name:"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuración proyectos"
|
||||
|
||||
msgctxt "model:asset.project.configuration.company,name:"
|
||||
msgid "Asset Project Configuration per Company"
|
||||
msgstr "Configuración proyectos de activos por empresa"
|
||||
|
||||
msgctxt "model:asset.project.sale.line,name:"
|
||||
msgid "Project Sale Line"
|
||||
msgstr "Linea de venta de proyectos"
|
||||
|
||||
msgctxt "model:ir.action,name:act_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyectos de activos"
|
||||
|
||||
msgctxt "model:ir.action,name:act_configuration_form"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuración proyectos"
|
||||
|
||||
msgctxt "model:ir.action,name:act_invoices_form"
|
||||
msgid "Invoices"
|
||||
msgstr "Facturas"
|
||||
|
||||
msgctxt "model:ir.action,name:act_return_form"
|
||||
msgid "Returns"
|
||||
msgstr "Albaranes de devolución"
|
||||
|
||||
msgctxt "model:ir.action,name:act_shipment_form"
|
||||
msgid "Shipments"
|
||||
msgstr "Albaranes"
|
||||
|
||||
msgctxt "model:ir.action,name:act_shipment_work_form"
|
||||
msgid "Shipment Work"
|
||||
msgstr "Albaranes de trabajo"
|
||||
|
||||
msgctxt "model:ir.action,name:act_timesheet_lines_form"
|
||||
msgid "Timesheet Lines"
|
||||
msgstr "Líneas de parte de trabajo"
|
||||
|
||||
msgctxt "model:ir.sequence,name:sequence_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyecto de activos"
|
||||
|
||||
msgctxt "model:ir.sequence.type,name:sequence_type_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyecto de activos"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyectos de activos"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_configuration_form"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuración proyectos"
|
||||
|
||||
msgctxt "model:res.group,name:group_asset_project"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyecto de activos"
|
||||
|
||||
msgctxt "model:res.group,name:group_asset_project_admin"
|
||||
msgid "Asset Project Administration"
|
||||
msgstr "Administración proyectos de activos"
|
||||
|
||||
msgctxt "view:asset.project.configuration:"
|
||||
msgid "Project Configuration"
|
||||
msgstr "Configuración proyectos"
|
||||
|
||||
msgctxt "view:asset.project.sale.line:"
|
||||
msgid "Project Sale Line"
|
||||
msgstr "Linea de venta de proyectos"
|
||||
|
||||
msgctxt "view:asset.project.sale.line:"
|
||||
msgid "Project Sale lines"
|
||||
msgstr "Linea de venta de proyectos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Amounts"
|
||||
msgstr "Importes"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Asset Project"
|
||||
msgstr "Proyectos de activos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Asset Projects"
|
||||
msgstr "Proyectos de activos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Expense"
|
||||
msgstr "Gastos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Income"
|
||||
msgstr "Ingresos"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Invoice"
|
||||
msgstr "Factura"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Margins"
|
||||
msgstr "Margenes"
|
||||
|
||||
msgctxt "view:asset.project:"
|
||||
msgid "Shipments"
|
||||
msgstr "Albaranes"
|
|
@ -0,0 +1,99 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from setuptools import setup
|
||||
import re
|
||||
import os
|
||||
import ConfigParser
|
||||
|
||||
MODULE = 'asset_project'
|
||||
PREFIX = 'nantic'
|
||||
MODULE2PREFIX = {}
|
||||
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
|
||||
def get_require_version(name):
|
||||
if minor_version % 2:
|
||||
require = '%s >= %s.%s.dev0, < %s.%s'
|
||||
else:
|
||||
require = '%s >= %s.%s, < %s.%s'
|
||||
require %= (name, major_version, minor_version,
|
||||
major_version, minor_version + 1)
|
||||
return require
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config.readfp(open('tryton.cfg'))
|
||||
info = dict(config.items('tryton'))
|
||||
for key in ('depends', 'extras_depend', 'xml'):
|
||||
if key in info:
|
||||
info[key] = info[key].strip().splitlines()
|
||||
|
||||
version = info.get('version', '0.0.1')
|
||||
major_version, minor_version, _ = version.split('.', 2)
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
requires = []
|
||||
for dep in info.get('depends', []):
|
||||
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
||||
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
||||
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
||||
(prefix, dep, major_version, minor_version,
|
||||
major_version, minor_version + 1))
|
||||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = [get_require_version('proteus')]
|
||||
|
||||
setup(name='%s_%s' % (PREFIX, MODULE),
|
||||
version=version,
|
||||
description='',
|
||||
long_description=read('README'),
|
||||
author='NaN·tic',
|
||||
author_email='info@nan-tic.com',
|
||||
url='http://www.nan-tic.com/',
|
||||
download_url="https://bitbucket.org/nantic/trytond-%s" % MODULE,
|
||||
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
||||
packages=[
|
||||
'trytond.modules.%s' % MODULE,
|
||||
'trytond.modules.%s.tests' % MODULE,
|
||||
],
|
||||
package_data={
|
||||
'trytond.modules.%s' % MODULE: (info.get('xml', [])
|
||||
+ ['tryton.cfg', 'locale/*.po', 'tests/*.rst']),
|
||||
},
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Plugins',
|
||||
'Framework :: Tryton',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: Financial and Insurance Industry',
|
||||
'Intended Audience :: Legal Industry',
|
||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||
'Natural Language :: Bulgarian',
|
||||
'Natural Language :: Catalan',
|
||||
'Natural Language :: Czech',
|
||||
'Natural Language :: Dutch',
|
||||
'Natural Language :: English',
|
||||
'Natural Language :: French',
|
||||
'Natural Language :: German',
|
||||
'Natural Language :: Russian',
|
||||
'Natural Language :: Spanish',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Topic :: Office/Business',
|
||||
],
|
||||
license='GPL-3',
|
||||
install_requires=requires,
|
||||
zip_safe=False,
|
||||
entry_points="""
|
||||
[trytond.modules]
|
||||
%s = trytond.modules.%s
|
||||
""" % (MODULE, MODULE),
|
||||
test_suite='tests',
|
||||
test_loader='trytond.test_loader:Loader',
|
||||
tests_require=tests_require,
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from .test_asset_project import suite
|
|
@ -0,0 +1,311 @@
|
|||
============================
|
||||
Asset Project Scenario
|
||||
============================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install sale::
|
||||
|
||||
>>> Module = Model.get('ir.module.module')
|
||||
>>> sale_module, = Module.find([('name', '=', 'asset_project')])
|
||||
>>> Module.install([sale_module.id], config.context)
|
||||
>>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> Currency = Model.get('currency.currency')
|
||||
>>> CurrencyRate = Model.get('currency.currency.rate')
|
||||
>>> currencies = Currency.find([('code', '=', 'USD')])
|
||||
>>> if not currencies:
|
||||
... currency = Currency(name='U.S. Dollar', symbol='$', code='USD',
|
||||
... rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
|
||||
... mon_decimal_point='.', mon_thousands_sep=',')
|
||||
... currency.save()
|
||||
... CurrencyRate(date=today + relativedelta(month=1, day=1),
|
||||
... rate=Decimal('1.0'), currency=currency).save()
|
||||
... else:
|
||||
... currency, = currencies
|
||||
>>> Company = Model.get('company.company')
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> company_config = Wizard('company.company.config')
|
||||
>>> company_config.execute('company')
|
||||
>>> company = company_config.form
|
||||
>>> party = Party(name='Dunder Mifflin')
|
||||
>>> party.save()
|
||||
>>> company.party = party
|
||||
>>> company.currency = currency
|
||||
>>> company_config.execute('add')
|
||||
>>> company, = Company.find([])
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> Group = Model.get('res.group')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> FiscalYear = Model.get('account.fiscalyear')
|
||||
>>> Sequence = Model.get('ir.sequence')
|
||||
>>> SequenceStrict = Model.get('ir.sequence.strict')
|
||||
>>> fiscalyear = FiscalYear(name=str(today.year))
|
||||
>>> fiscalyear.start_date = today + relativedelta(month=1, day=1)
|
||||
>>> fiscalyear.end_date = today + relativedelta(month=12, day=31)
|
||||
>>> fiscalyear.company = company
|
||||
>>> post_move_seq = Sequence(name=str(today.year), code='account.move',
|
||||
... company=company)
|
||||
>>> post_move_seq.save()
|
||||
>>> fiscalyear.post_move_sequence = post_move_seq
|
||||
>>> invoice_seq = SequenceStrict(name=str(today.year),
|
||||
... code='account.invoice', company=company)
|
||||
>>> invoice_seq.save()
|
||||
>>> fiscalyear.out_invoice_sequence = invoice_seq
|
||||
>>> fiscalyear.in_invoice_sequence = invoice_seq
|
||||
>>> fiscalyear.out_credit_note_sequence = invoice_seq
|
||||
>>> fiscalyear.in_credit_note_sequence = invoice_seq
|
||||
>>> fiscalyear.save()
|
||||
>>> FiscalYear.create_period([fiscalyear.id], config.context)
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
>>> AccountTemplate = Model.get('account.account.template')
|
||||
>>> Account = Model.get('account.account')
|
||||
>>> Journal = Model.get('account.journal')
|
||||
>>> account_template, = AccountTemplate.find([('parent', '=', None)])
|
||||
>>> create_chart = Wizard('account.create_chart')
|
||||
>>> create_chart.execute('account')
|
||||
>>> create_chart.form.account_template = account_template
|
||||
>>> create_chart.form.company = company
|
||||
>>> create_chart.execute('create_account')
|
||||
>>> receivable, = Account.find([
|
||||
... ('kind', '=', 'receivable'),
|
||||
... ('company', '=', company.id),
|
||||
... ])
|
||||
>>> payable, = Account.find([
|
||||
... ('kind', '=', 'payable'),
|
||||
... ('company', '=', company.id),
|
||||
... ])
|
||||
>>> revenue, = Account.find([
|
||||
... ('kind', '=', 'revenue'),
|
||||
... ('company', '=', company.id),
|
||||
... ])
|
||||
>>> expense, = Account.find([
|
||||
... ('kind', '=', 'expense'),
|
||||
... ('company', '=', company.id),
|
||||
... ])
|
||||
>>> create_chart.form.account_receivable = receivable
|
||||
>>> create_chart.form.account_payable = payable
|
||||
>>> create_chart.execute('create_properties')
|
||||
>>> cash, = Account.find([
|
||||
... ('kind', '=', 'other'),
|
||||
... ('name', '=', 'Main Cash'),
|
||||
... ('company', '=', company.id),
|
||||
... ])
|
||||
>>> cash_journal, = Journal.find([('type', '=', 'cash')])
|
||||
>>> cash_journal.credit_account = cash
|
||||
>>> cash_journal.debit_account = cash
|
||||
>>> cash_journal.save()
|
||||
|
||||
Create Employee::
|
||||
|
||||
>>> Employee = Model.get('company.employee')
|
||||
>>> party = Party(name='Employee')
|
||||
>>> party.save()
|
||||
>>> employee = Employee()
|
||||
>>> employee.party = party
|
||||
>>> employee.company = company
|
||||
>>> cost = employee.cost_prices.new()
|
||||
>>> cost.date = today
|
||||
>>> cost.cost_price = Decimal('10.0')
|
||||
>>> employee.save()
|
||||
>>> user, = User.find([])
|
||||
>>> user.employees.append(employee)
|
||||
>>> user.employee = employee
|
||||
>>> user.save()
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create parties::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> supplier = Party(name='Supplier')
|
||||
>>> supplier.save()
|
||||
>>> customer = Party(name='Customer')
|
||||
>>> customer.save()
|
||||
|
||||
Create category::
|
||||
|
||||
>>> ProductCategory = Model.get('product.category')
|
||||
>>> category = ProductCategory(name='Category')
|
||||
>>> category.save()
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
|
||||
>>> ProductTemplate = Model.get('product.template')
|
||||
>>> Product = Model.get('product.product')
|
||||
>>> product = Product()
|
||||
>>> template = ProductTemplate()
|
||||
>>> template.name = 'product'
|
||||
>>> template.category = category
|
||||
>>> template.default_uom = unit
|
||||
>>> template.type = 'assets'
|
||||
>>> template.purchasable = True
|
||||
>>> template.salable = True
|
||||
>>> template.list_price = Decimal('10')
|
||||
>>> template.cost_price = Decimal('8')
|
||||
>>> template.cost_price_method = 'fixed'
|
||||
>>> template.account_expense = expense
|
||||
>>> template.account_revenue = revenue
|
||||
>>> template.save()
|
||||
>>> product.template = template
|
||||
>>> product.save()
|
||||
|
||||
>>> service = Product()
|
||||
>>> template = ProductTemplate()
|
||||
>>> template.name = 'service'
|
||||
>>> template.default_uom = unit
|
||||
>>> template.type = 'service'
|
||||
>>> template.salable = True
|
||||
>>> template.list_price = Decimal('30')
|
||||
>>> template.cost_price = Decimal('10')
|
||||
>>> template.cost_price_method = 'fixed'
|
||||
>>> template.account_expense = expense
|
||||
>>> template.account_revenue = revenue
|
||||
>>> template.save()
|
||||
>>> service.template = template
|
||||
>>> service.save()
|
||||
|
||||
Create payment term::
|
||||
|
||||
>>> PaymentTerm = Model.get('account.invoice.payment_term')
|
||||
>>> PaymentTermLine = Model.get('account.invoice.payment_term.line')
|
||||
>>> payment_term = PaymentTerm(name='Direct')
|
||||
>>> payment_term_line = PaymentTermLine(type='remainder', days=0)
|
||||
>>> payment_term.lines.append(payment_term_line)
|
||||
>>> payment_term.save()
|
||||
|
||||
Create an asset::
|
||||
|
||||
>>> Asset = Model.get('asset')
|
||||
>>> asset = Asset()
|
||||
>>> asset.name = 'Asset'
|
||||
>>> asset.product = product
|
||||
>>> asset.save()
|
||||
|
||||
Create a Sale::
|
||||
|
||||
>>> Sale = Model.get('sale.sale')
|
||||
>>> sale = Sale()
|
||||
>>> sale.party = customer
|
||||
>>> sale.payment_term = payment_term
|
||||
>>> sale_line = sale.lines.new()
|
||||
>>> sale_line.product = product
|
||||
>>> sale_line.quantity = 10
|
||||
>>> sale_line = sale.lines.new()
|
||||
>>> sale_line.product = service
|
||||
>>> sale_line.quantity = 5
|
||||
>>> sale_line = sale.lines.new()
|
||||
>>> sale_line.description = 'Taxes'
|
||||
>>> sale_line.quantity = 1
|
||||
>>> sale_line.unit_price = Decimal('15.0')
|
||||
>>> sale.save()
|
||||
|
||||
Create a Project::
|
||||
|
||||
>>> Project = Model.get('asset.project')
|
||||
>>> project = Project()
|
||||
>>> project.code = 'MAIN'
|
||||
>>> project.party = customer
|
||||
>>> project.asset = asset
|
||||
>>> project.sales.append(sale)
|
||||
>>> project.save()
|
||||
>>> project.income_labor
|
||||
Decimal('150.00')
|
||||
>>> project.income_material
|
||||
Decimal('100.00')
|
||||
>>> project.income_other
|
||||
Decimal('15.00')
|
||||
>>> project.expense_material
|
||||
Decimal('80.00')
|
||||
>>> project.expense_labor
|
||||
Decimal('0.0')
|
||||
>>> project.expense_other
|
||||
Decimal('0.0')
|
||||
>>> project.margin_labor
|
||||
Decimal('150.00')
|
||||
>>> project.margin_percent_labor
|
||||
Decimal('1.0')
|
||||
>>> project.margin_material
|
||||
Decimal('20.00')
|
||||
>>> project.margin_percent_material
|
||||
Decimal('0.25')
|
||||
>>> project.margin_other
|
||||
Decimal('15.00')
|
||||
>>> project.margin_percent_other
|
||||
Decimal('1.0')
|
||||
|
||||
Create a milestone and confirm the sale::
|
||||
|
||||
>>> MileStoneGroup = Model.get('account.invoice.milestone.group')
|
||||
>>> SaleLine = Model.get('sale.line')
|
||||
>>> group = MileStoneGroup(party=customer)
|
||||
>>> first_milestone = group.lines.new()
|
||||
>>> first_milestone.invoice_method = 'amount'
|
||||
>>> first_milestone.trigger = 'manual'
|
||||
>>> first_milestone.amount = Decimal('150.0')
|
||||
>>> product_line = SaleLine(sale.lines[0].id)
|
||||
>>> first_milestone.trigger_lines.append(product_line)
|
||||
>>> second_milestone = group.lines.new()
|
||||
>>> second_milestone.invoice_method = 'amount'
|
||||
>>> second_milestone.trigger = 'manual'
|
||||
>>> second_milestone.amount = Decimal('100.0')
|
||||
>>> service_line = SaleLine(sale.lines[1].id)
|
||||
>>> second_milestone.trigger_lines.append(service_line)
|
||||
>>> group.save()
|
||||
>>> sale.milestone_group = group
|
||||
>>> sale.click('quote')
|
||||
>>> sale.click('confirm')
|
||||
>>> project.reload()
|
||||
>>> project.amount_to_assign
|
||||
Decimal('265.00')
|
||||
>>> project.amount_milestones
|
||||
Decimal('265.00')
|
||||
|
||||
Create a shipment work and check that the cost is updated::
|
||||
|
||||
>>> shipment = project.work_shipments.new()
|
||||
>>> shipment.work_name = 'Work'
|
||||
>>> shipment.work_description = 'Work'
|
||||
>>> shipment.party = customer
|
||||
>>> project.save()
|
||||
>>> project.reload()
|
||||
>>> shipment, = project.work_shipments
|
||||
>>> shipment.click('pending')
|
||||
>>> shipment.planned_date = today
|
||||
>>> shipment.click('plan')
|
||||
>>> shipment.done_description = 'Done'
|
||||
>>> shipment.click('done')
|
||||
>>> timesheet = shipment.timesheet_lines.new()
|
||||
>>> timesheet.employee = employee
|
||||
>>> timesheet.hours = 3.0
|
||||
>>> shipment.save()
|
||||
>>> project.reload()
|
||||
>>> project.expense_labor
|
||||
Decimal('30.00')
|
||||
>>> project.margin_labor
|
||||
Decimal('120.00')
|
||||
>>> project.margin_percent_labor
|
||||
Decimal('4')
|
|
@ -0,0 +1,30 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
import unittest
|
||||
import doctest
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import test_view, test_depends, doctest_dropdb
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
'Test module'
|
||||
|
||||
def setUp(self):
|
||||
trytond.tests.test_tryton.install_module('asset_project')
|
||||
|
||||
def test0005views(self):
|
||||
'Test views'
|
||||
test_view('asset_project')
|
||||
|
||||
def test0006depends(self):
|
||||
'Test depends'
|
||||
test_depends()
|
||||
|
||||
|
||||
def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_asset_project.rst',
|
||||
setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
|
||||
return suite
|
|
@ -0,0 +1,13 @@
|
|||
[tryton]
|
||||
version=3.2.0
|
||||
depends:
|
||||
account_invoice_milestone
|
||||
asset_maintenance
|
||||
shipment_work
|
||||
sale
|
||||
timesheet_cost
|
||||
extras_depend:
|
||||
sale_margin
|
||||
xml:
|
||||
asset.xml
|
||||
configuration.xml
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Project Configuration">
|
||||
<label name="project_sequence"/>
|
||||
<field name="project_sequence"/>
|
||||
</form>
|
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Asset Project">
|
||||
<label name="code"/>
|
||||
<field name="code"/>
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<label name="asset"/>
|
||||
<field name="asset"/>
|
||||
<label name="party"/>
|
||||
<field name="party"/>
|
||||
<label name="milestone_group"/>
|
||||
<field name="milestone_group"/>
|
||||
<newline/>
|
||||
<label name="start_date"/>
|
||||
<field name="start_date"/>
|
||||
<label name="end_date"/>
|
||||
<field name="end_date"/>
|
||||
<label name="maintenance"/>
|
||||
<field name="maintenance"/>
|
||||
<label name="category"/>
|
||||
<field name="category"/>
|
||||
<label name="date_planned"/>
|
||||
<field name="date_planned"/>
|
||||
<label name="date_start"/>
|
||||
<field name="date_start"/>
|
||||
<label name="date_done"/>
|
||||
<field name="date_done"/>
|
||||
<label name="date_next"/>
|
||||
<field name="date_next"/>
|
||||
<notebook>
|
||||
<page id="amounts" string="Amounts" col="6">
|
||||
<separator id="invoice" string="Invoice" colspan="6"/>
|
||||
<label name="amount_to_assign"/>
|
||||
<field name="amount_to_assign"/>
|
||||
<label name="amount_invoice"/>
|
||||
<field name="amount_invoice"/>
|
||||
<label name="amount_milestones"/>
|
||||
<field name="amount_milestones"/>
|
||||
<separator id="income" string="Income" colspan="6"/>
|
||||
<label name="income_labor"/>
|
||||
<field name="income_labor"/>
|
||||
<label name="income_material"/>
|
||||
<field name="income_material"/>
|
||||
<label name="income_other"/>
|
||||
<field name="income_other"/>
|
||||
<separator id="expense" string="Expense" colspan="6"/>
|
||||
<label name="expense_labor"/>
|
||||
<field name="expense_labor"/>
|
||||
<label name="expense_material"/>
|
||||
<field name="expense_material"/>
|
||||
<label name="expense_other"/>
|
||||
<field name="expense_other"/>
|
||||
<separator id="margin" string="Margins" colspan="6"/>
|
||||
<label name="margin_labor"/>
|
||||
<field name="margin_labor"/>
|
||||
<label name="margin_material"/>
|
||||
<field name="margin_material"/>
|
||||
<label name="margin_other"/>
|
||||
<field name="margin_other"/>
|
||||
<label name="margin_percent_labor"/>
|
||||
<field name="margin_percent_labor" factor="100"/>
|
||||
<label name="margin_percent_material"/>
|
||||
<field name="margin_percent_material" factor="100"/>
|
||||
<label name="margin_percent_other"/>
|
||||
<field name="margin_percent_other" factor="100"/>
|
||||
</page>
|
||||
<page name="sales">
|
||||
<field name="sales"/>
|
||||
<field name="sale_lines"/>
|
||||
</page>
|
||||
<page name="milestones">
|
||||
<field name="milestones"/>
|
||||
</page>
|
||||
<page name="work_shipments">
|
||||
<field name="work_shipments"/>
|
||||
</page>
|
||||
<page string="Shipments" id="shipments">
|
||||
<field name="moves" colspan="4"/>
|
||||
<field name="shipments" colspan="4"/>
|
||||
<field name="shipment_returns" colspan="4"/>
|
||||
</page>
|
||||
<page name="note">
|
||||
<field name="note" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="Asset Projects">
|
||||
<field name="company"/>
|
||||
<field name="code"/>
|
||||
<field name="party"/>
|
||||
<field name="asset"/>
|
||||
<field name="maintenance"/>
|
||||
</tree>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Project Sale lines">
|
||||
<label name="project"/>
|
||||
<field name="project"/>
|
||||
<label name="product"/>
|
||||
<field name="product"/>
|
||||
<label name="quantity"/>
|
||||
<field name="quantity"/>
|
||||
<label name="unit"/>
|
||||
<field name="unit"/>
|
||||
<label name="unit_price"/>
|
||||
<field name="unit_price"/>
|
||||
<label name="amount"/>
|
||||
<field name="amount"/>
|
||||
<label name="currency"/>
|
||||
<field name="currency"/>
|
||||
</form>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="Project Sale Line">
|
||||
<field name="project"/>
|
||||
<field name="product"/>
|
||||
<field name="quantity"/>
|
||||
<field name="unit"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="amount"/>
|
||||
</tree>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id='other']/label[@name='milestone_group']"
|
||||
position="replace">
|
||||
<label name="project"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@id='other']/field[@name='milestone_group']"
|
||||
position="replace">
|
||||
<field name="project"/>
|
||||
</xpath>
|
||||
</data>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook" position="before">
|
||||
<label name="project"/>
|
||||
<field name="project"/>
|
||||
</xpath>
|
||||
</data>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/tree/field[@name='work_name']" position="after">
|
||||
<field name="project"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in New Issue