upgrade v16 addons valores por defecto según la categoría interna

This commit is contained in:
snt 2024-09-04 23:07:41 +02:00
parent 688782abd8
commit 412d897695
88 changed files with 4 additions and 4787 deletions

613
LICENSE
View file

@ -1,613 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for software
and other kinds of works, specifically designed to ensure cooperation with
the community in the case of network server software.
The licenses for most software and other practical works are designed to take
away your freedom to share and change the works. By contrast, our General
Public Licenses are 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.
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.
Developers that use our General Public Licenses protect your rights with two
steps: (1) assert copyright on the software, and (2) offer you this License
which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made
in alternate versions of the program, if they receive widespread use, become
available for other developers to incorporate. Many developers of free software
are heartened and encouraged by the resulting cooperation. However, in the
case of software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and letting
the public access it on a server without ever releasing its source code to
the public.
The GNU Affero General Public License is designed specifically to ensure that,
in such cases, the modified source code becomes available to the community.
It requires the operator of a network server to provide the source code of
the modified version running there to the users of that server. Therefore,
public use of a modified version, on a publicly accessible server, gives the
public access to the source code of the modified version.
An older license, called the Affero General Public License and published by
Affero, was designed to accomplish similar goals. This is a different license,
not a version of the Affero GPL, but Affero has released a new version of
the Affero GPL which permits relicensing under this license.
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 Affero 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 s ue 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. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program,
your modified version must prominently offer all users interacting with it
remotely through a computer network (if your version supports such interaction)
an opportunity to receive the Corresponding Source of your version by providing
access to the Corresponding Source from a network server at no charge, through
some standard or customary means of facilitating copying of software. This
Corresponding Source shall include the Corresponding Source for any work covered
by version 3 of the GNU General Public License that is incorporated pursuant
to the following paragraph.
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 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 work with which it is combined will remain
governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network,
you should also make sure that it provides a way for users to get its source.
For example, if your program is a web application, its interface could display
a "Source" link that leads users to an archive of the code. There are many
ways you could offer source, and different solutions will be better for different
programs; see section 13 for the specific requirements.
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 AGPL, see <https://www.gnu.org/licenses/>.

View file

@ -1,3 +0,0 @@
# addons_cm
addons personalizados por Criptomart

View file

@ -1,29 +0,0 @@
# Copyright (C) 2022 - Today: Criptomart (https://criptomart.net)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Criptomart - Must Have Modules",
"summary": "Install must have modules",
"version": "16.0.1.0.0",
"category": "CriptoMart - Custom",
"author": "Criptmart",
"website": "https://github.com/criptomart",
"license": "AGPL-3",
"depends": [
"web_responsive",
"web_refresher",
"web_no_bubble",
"web_favicon",
"web_decimal_numpad_dot",
"pos_accented_search",
"remove_odoo_enterprise",
"website_odoo_debranding",
"disable_odoo_online",
"partner_disable_gravatar",
"base_technical_features",
"module_auto_update",
"mass_editing",
"auto_backup"
],
"installable": True,
}

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,35 +0,0 @@
{
'name': "Network Partner",
'summary': "Makes networks based in nodes of Partners.",
'description': """
Network partners
==================================================
Introduce el concepto de "nodo" y "red" en contactos asociados.
No proporciona funcionalidad por mismo, se usará luego en otros módulos.
- Modelo network
- Modelo nodo
- Añade campos node_id, is_node a res.partner
- Reglas de seguridad y access lists
""",
'author': 'Criptomart',
'website': "https://criptomart.net",
'category': 'Contacts',
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'depends': ['base','stock'],
'data': [
'views/res_partner_views.xml',
'views/partner_node_views.xml',
'views/partner_net_views.xml',
'security/network_partner_security.xml',
'security/ir.model.access.csv',
'views/actions.xml',
'views/menus.xml',
],
'demo': [],
'installable': True,
'auto_install': False,
'application': False,
}

View file

@ -1,4 +0,0 @@
from . import res_partner
from . import partner_node
from . import partner_network

View file

@ -1,15 +0,0 @@
#import logging
from odoo import models, fields, api
#_logger = logging.getLogger(__name__)
class PartnerNetwork(models.Model):
_name = 'partner.network'
#_inherit = 'mail.thread'
_description = 'A network of nodes.'
name = fields.Char(string="Nombre", help="El nombre de la red.")
nodes_ids = fields.One2many('partner.node', 'network_id', string="Nodos de la red", help="Los nodos de usuarios finales que conforman la red")

View file

@ -1,16 +0,0 @@
#import logging
from odoo import models, fields, api
#_logger = logging.getLogger(__name__)
class PartnerNode(models.Model):
_name = 'partner.node'
_description = 'A node of partners in a network'
name = fields.Char(string="Nombre", help="Cómo se denomina el nodo.")
network_id = fields.Many2one('partner.network', string="Red", help="La red a la que pertenece el nodo.")
partner_ids = fields.One2many('res.partner', 'node_id', string='Contactos del nodo', help='Los contactos asociados a éste nodo.')

View file

@ -1,14 +0,0 @@
#import logging
from odoo import models, fields, api
#_logger = logging.getLogger(__name__)
class ResPartner(models.Model):
_inherit = 'res.partner'
#'users': fields.many2many('res.users', 'res_groups_users_rel', 'gid', 'uid', 'Users'),
node_id = fields.Many2one('partner.node', string="Nodo")
is_node = fields.Boolean(string="Es un nodo", help="Éste partner representa un nodo en una red.")

View file

@ -1,5 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_network_partner_node_group_user,network.partner.node.user,network_partner.model_partner_node,network_partner.group_np_user,1,0,0,0
access_network_partner_node_group_manager,network.partner.node.manager,network_partner.model_partner_node,network_partner.group_np_manager,1,1,1,1
access_network_partner_net_group_user,network.partner.net.user,network_partner.model_partner_network,network_partner.group_np_user,1,0,0,0
access_network_partner_net_group_manager,network.partner.net.manager,network_partner.model_partner_network,network_partner.group_np_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_network_partner_node_group_user network.partner.node.user network_partner.model_partner_node network_partner.group_np_user 1 0 0 0
3 access_network_partner_node_group_manager network.partner.node.manager network_partner.model_partner_node network_partner.group_np_manager 1 1 1 1
4 access_network_partner_net_group_user network.partner.net.user network_partner.model_partner_network network_partner.group_np_user 1 0 0 0
5 access_network_partner_net_group_manager network.partner.net.manager network_partner.model_partner_network network_partner.group_np_manager 1 1 1 1

View file

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.module.category" id="module_management">
<field name="name">Network Partner module access</field>
<field name="description">User access level for this module</field>
<field name="sequence">3</field>
</record>
<record id="group_np_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="network_partner.module_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
</record>
<record id="group_np_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="network_partner.module_management"/>
<field name="implied_ids" eval="[(4, ref('network_partner.group_np_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
</data>
<data noupdate="1">
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4,ref('network_partner.group_np_user'))]"/>
</record>
<record model="ir.rule" id="network_partner_node_read_rule">
<field name="name">network.partner.node.read.rule</field>
<field name="model_id" ref="model_partner_node" />
<field name="global" eval="True"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4,ref('network_partner.group_np_user'))]" />
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_create" eval="False"/>
</record>
<record model="ir.rule" id="network_partner_node_write_rule">
<field name="name">network.partner.node.write.rule</field>
<field name="model_id" ref="model_partner_node" />
<field name="global" eval="True"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4,ref('network_partner.group_np_manager'))]" />
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="network_partner_net_read_rule">
<field name="name">network.partner.net.read.rule</field>
<field name="model_id" ref="model_partner_network" />
<field name="global" eval="True"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4,ref('network_partner.group_np_user'))]" />
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_create" eval="False"/>
</record>
<record model="ir.rule" id="network_partner_net_write_rule">
<field name="name">network.partner.net.write.rule</field>
<field name="model_id" ref="model_partner_network" />
<field name="global" eval="True"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4,ref('network_partner.group_np_manager'))]" />
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
</data>
</odoo>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -1,38 +0,0 @@
<odoo>
<data>
<record id="action_partner_network_nets" model="ir.actions.act_window">
<field name="name">Networks</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">partner.network</field>
<field name="view_mode">tree,form</field>
<field name="context">{ }</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new Partner Network.
</p>
</field>
</record>
<record id="action_partner_network_nodes" model="ir.actions.act_window">
<field name="name">Nodes</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">partner.node</field>
<field name="view_mode">tree,form</field>
<field name="context">{ }</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new Node.
</p>
</field>
</record>
<record id="action_partner_network_view_node_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="network_partner.view_partner_network_node_tree"/>
<field name="act_window_id" ref="action_partner_network_nodes"/>
</record>
</data>
</odoo>

View file

@ -1,33 +0,0 @@
<odoo>
<data>
<!-- Top menu item -->
<menuitem
id="menu_network_partner_root"
name="Redes de Contactos"
sequence="5"
groups="group_np_user"
web_icon="network_partner,static/description/icon.png"
/>
<!-- Submenu -->
<menuitem id="menu_network_partner_sub"
parent="network_partner.menu_network_partner_root"
name ="Redes"
sequence="10"
groups="group_np_user"
/>
<!-- nodos -->
<menuitem action="network_partner.action_partner_network_nodes"
id="menu_partner_networks_nodes"
parent="network_partner.menu_network_partner_sub"
sequence="10"
groups="group_np_user"
/>
<!-- redes -->
<menuitem action="network_partner.action_partner_network_nets"
id="menu_partner_network_nets"
parent="network_partner.menu_network_partner_sub"
sequence="20"
groups="group_np_user"
/>
</data>
</odoo>

View file

@ -1,31 +0,0 @@
<odoo>
<data>
<record id="view_partner_network_net_form" model="ir.ui.view">
<field name="name">partner.network.nets.form</field>
<field name="model">partner.network</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<form string="Redes">
<group col="4">
<field name="name"/>
<field name="nodes_ids" widget="many2many_tags" />
</group>
</form>
</field>
</record>
<record id="view_partner_network_net_tree" model="ir.ui.view">
<field name="name">partner.network.nets.tree</field>
<field name="model">partner.network</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree string="Redes">
<field name="name"/>
<field name="nodes_ids" widget="many2many_tags" />
</tree>
</field>
</record>
</data>
</odoo>

View file

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_partner_network_node_form" model="ir.ui.view">
<field name="name">partner.network.node.form</field>
<field name="model">partner.node</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="Node">
<header>
<p>Soy el header...</p>
</header>
<sheet>
<group col="4">
<field name="name"/>
<field name="network_id"/>
<field name="partner_ids" widget="many2many_tags"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_partner_network_node_tree" model="ir.ui.view">
<field name="name">partner.network.node.tree</field>
<field name="model">partner.node</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Nodes">
<field name="name"/>
<field name="network_id"/>
<field name="partner_ids" widget="many2many_tags"/>
</tree>
</field>
</record>
</data>
</odoo>

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_res_partner_network" model="ir.ui.view">
<field name="name">Nodo</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">2</field>
<field name="arch" type="xml">
<xpath expr="//page[@name='internal_notes']" position="after">
<page name="nodes_page"
string="Nodes" >
<group name="nodes_information_group" >
<field name = "is_node"/>
<field name = "node_id" />
</group>
</page>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -1,34 +0,0 @@
Order:
The status of the purchase order or the quotation request. "
A request for quotation is a purchase order in a 'Draft' status.
Then the order has to be confirmed by the user responsible , the status switch to 'Confirmed'.
Then the supplier must confirm the order to change the status to 'Approved'.
When the purchase order is paid and received, the status becomes 'Done'.
If a cancel action occurs in the invoice or in the receipt of goods, the status becomes "in exception."
STATE_SELECTION = [
('draft', 'Draft PO'),
('sent', 'RFQ'),
('bid', 'Bid Received'),
('confirmed', 'Waiting Approval'),
('approved', 'Purchase Confirmed'),
('except_picking', 'Shipping Exception'),
('except_invoice', 'Invoice Exception'),
('done', 'Done'),
('cancel', 'Cancelled')
Order.Line:
'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')],
'Status', required=True, readonly=True, copy=False,
help=' * The \'Draft\' status is set automatically when purchase order in draft status. \
\n* The \'Confirmed\' status is set automatically as confirm when purchase order in confirm status. \
\n* The \'Done\' status is set automatically when purchase order is set as done. \
\n* The \'Cancelled\' status is set automatically when user cancel purchase order.'),

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,21 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Pos Picking Load Selected Partner',
'description': """
If a partner is selected in the PoS Order as client, search only the pickings related to this partner.""",
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
"point_of_sale",
"pos_picking_load"
],
'data': [
'views/assets.xml'
],
'demo': [
],
}

View file

@ -1 +0,0 @@
from . import stock_picking

View file

@ -1,15 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from odoo.tools import date_utils
import json
import logging
_logger = logging.getLogger(__name__)
class StockPicking(models.Model):
_inherit = 'stock.picking'

View file

@ -1,20 +0,0 @@
odoo.define('pos_picking_load_selected_partner.picking_partner', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
var gui = require('point_of_sale.gui');
var PickingPartner = gui.Gui.prototype.screen_classes.filter(function(el) {
return el.name == 'load_picking'
})[0].widget.include({
show: function () {
this._super();
var partner = this.pos.get_order().get_client();
var query = "";
if (partner){ query = partner.name; }
this.search_pickings(query);
}
});
return PickingPartner;
});

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_picking_load_selected_partner/static/src/js/widget.js"></script>
</xpath>
</template>
</odoo>

View file

@ -1,24 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Pos Receipt Clientinfo',
'description': """
Adds a report to print a simplified invoice with client tax data""",
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
'point_of_sale',
'l10n_es_pos'
],
'data': [
'views/report_receipt.xml'
],
'qweb': [
'static/src/xml/pos.xml',
],
'demo': [
],
}

View file

@ -1,308 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="PosTicket">
<t t-jquery=".pos-sale-ticket" t-operation="replace">
<div class="pos-sale-ticket" style="padding-left: 18px; padding-right: 18px;">
<div class="pos-center-align"><img t-att-src="widget.pos.company_logo_base64" width="200px" /></div>
<div class="pos-left-align"><t t-esc="widget.pos.company.name" /><br /></div>
<div class="pos-left-align"><t t-esc="widget.pos.company.street" /> - <t t-esc="widget.pos.company.city" /> - <t t-esc="widget.pos.company.zip" /><br /></div>
<div class="pos-left-align"><t t-esc="widget.pos.company.vat" /><br /></div>
<div class="receipt-phone pos-left-align">
Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
</div>
<br />
<div style="border-bottom: 1px dashed"></div>
<t t-if="order.get_client()">
<br/>
<span class="customer_title">Cooperativista: </span> <t t-esc="order.get_client().barcode_base ? order.get_client().barcode_base : ''"/><br />
Name: <t t-esc="order.get_client().name ? order.get_client().name : ''"/><br />
<t t-if="order.get_client().vat">
VAT: <t t-esc="order.get_client().vat" /><br />
</t>
<t t-if="order.get_client().address != ', , '">
<t t-esc="order.get_client().address" />
</t>
</t>
<t t-if="receipt.header">
<div style='text-align:center'>
<t t-esc="receipt.header" />
</div>
<br />
</t>
<div style="border-bottom: 1px dashed"></div>
<br />
<table width="100%" class='receipt-orderlines' >
<t t-foreach="orderlines" t-as="orderline">
<tr style="margin-top: 5px;">
<td colspan="4">
<t t-esc="orderline.get_product().display_name"/>
</td>
</tr>
<tr width="100%">
<td></td>
<td class="pos-right-align">
<t t-if="orderline.get_unit().name == 'Unidad(es)'">
<t t-esc="orderline.get_quantity()"/> Ud.
</t>
<t t-else="">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</t>
</td>
<td class="pos-right-align">
<div>
x <t t-esc="widget.format_currency(orderline.get_unit_display_price(), 'Product Price')"/>
</div>
</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(orderline.get_display_price())"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-total'>
<tr>
<td>Subtotal:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_without_tax())"/>
</td>
</tr>
<t t-foreach="order.get_tax_details()" t-as="taxdetail">
<tr>
<td><t t-esc="taxdetail.name" /></td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(taxdetail.amount)" />
</td>
</tr>
</t>
<tr>
<t t-if="order.get_total_discount() > 0">
<td>Discount:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_discount())"/>
</td>
</t>
</tr>
<t t-if="order.get_rounding_applied()">
<tr>
<td>Total:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</td>
</tr>
<tr class="emph">
<td>Total Redondeado:</td>
<td class="pos-right-align">
<t t-esc='widget.format_currency(receipt.total_rounded)' />
</td>
</tr>
</t>
<t t-else="">
<tr class="emph">
<td>Total:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-paymentlines'>
<t t-foreach="paymentlines" t-as="line">
<tr>
<td>
<t t-esc="line.name"/>
</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(line.get_amount())"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-change'>
<tr><td>Change:</td><td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_change())"/>
</td></tr>
</table>
<t t-if="receipt.footer">
<br />
<div style='text-align:center'>
<t t-esc="receipt.footer" />
</div>
</t>
<br />
<div class="pos-center-align">
<t t-esc="order.formatted_validation_date"/>
<t t-if="widget.pos.config.iface_l10n_es_simplified_invoice and !order.is_to_invoice()">
<br/><span>Simplified invoice: </span>
</t>
<t t-esc="order.name"/>
</div>
</div>
</t>
</t>
<t t-extend="XmlReceipt">
<t t-jquery="receipt" t-operation="replace">
<receipt align='center' width='45' value-thousands-separator='' >
<t t-if='receipt.company.logo'>
<img t-att-src='receipt.company.logo' alt="Logo"/>
<br/>
</t>
<t t-if='receipt.company.name'>
<div><t t-esc='receipt.company.name' /></div>
</t>
<t t-if='widget.pos.company.street'>
<div><t t-esc="widget.pos.company.street" /> - <t t-esc="widget.pos.company.city" /> - <t t-esc="widget.pos.company.zip" /></div>
</t>
<t t-if='receipt.company.vat'>
<div>VAT:<t t-esc='receipt.company.vat' /></div>
</t>
<t t-if='receipt.company.phone'>
<div>Tel:<t t-esc='receipt.company.phone' /></div>
</t>
<div>--------------------------------</div>
<t t-if="order.get_client()">
<span class="customer_title">Cooperativista: </span> <t t-esc="order.get_client().barcode_base ? order.get_client().barcode_base : ''"/><br />
Name: <t t-esc="order.get_client().name ? order.get_client().name : ''"/><br />
VAT: <t t-esc="order.get_client().vat ? order.get_client().vat : ''"/><br />
Address: <t t-esc="order.get_client().address ? order.get_client().address : ''"/>
</t>
<div>--------------------------------</div>
<t t-if='receipt.header_xml'>
<t t-raw='receipt.header_xml' />
</t>
<t t-if='!receipt.header_xml and receipt.header'>
<div><t t-esc='receipt.header' /></div>
</t>
<t t-if='receipt.cashier'>
<div class='cashier'>
<div>Served by <t t-esc='receipt.cashier' /></div>
<div>--------------------------------</div>
</div>
</t>
<div class='orderlines' line-ratio='0.6' >
<t t-foreach="receipt.orderlines" t-as="line">
<div align='left'>
<t t-esc="line.product_name_wrapped[0]" /><t t-esc="line.product_name_wrapped[1]" />
</div>
<t t-if="line.product_name_wrapped[2]">
<div align='left'>
<t t-esc="line.product_name_wrapped[2]" /><t t-esc="line.product_name_wrapped[3]" />
</div>
</t>
<line indent='1'>
<left>
<t t-if="line.unit_name == 'Unidad(es)'">
<t t-esc="line.quantity"/> Ud.
</t>
<t t-else="">
<value t-att-value-decimals='pos.dp["Product Unit of Measure"]'><t t-esc="line.quantity"/></value>
<t t-esc="line.unit_name" />
</t>
<div>
x <t t-esc="widget.format_currency(line.price, 'Product Price')"/>
</div>
</left>
<right>
<value t-att-value-decimals='pos.dp["Product Price"]'>
<t t-esc='line.price_display' />
</value>
</right>
</line>
</t>
</div>
<div>--------------------------------</div>
<div class='receipt-total'>
<line>
<left>Subtotal:</left>
<right>
<t t-esc="widget.format_currency(order.get_total_without_tax())"/>
</right>
</line>
<t t-foreach="order.get_tax_details()" t-as="taxdetail">
<line>
<left><t t-esc="taxdetail.name" /></left>
<right>
<t t-esc="widget.format_currency(taxdetail.amount)" />
</right>
</line>
</t>
<t t-if="order.get_total_discount() > 0">
<line>
<left>Discount:</left>
<right>
<t t-esc="widget.format_currency(order.get_total_discount())"/>
</right>
</line>
</t>
<t t-if="receipt.rounding_applied">
<line>
<left>Total:</left>
<right>
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</right>
</line>
<line size="double-height">
<left>Total (Redondeado):</left>
<right>
<t t-esc='widget.format_currency(receipt.total_rounded)' />
</right>
</line>
</t>
<t t-else="">
<line size="double-height">
<left>Total:</left>
<right>
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</right>
</line>
</t>
</div>
<div>--------------------------------</div>
<div class='receipt-paymentlines'>
<t t-foreach="paymentlines" t-as="line">
<line>
<left>
<t t-esc="line.name"/>
</left>
<right class="pos-right-align">
<t t-esc="widget.format_currency(line.get_amount())"/>
</right>
</line>
</t>
</div>
<div class='receipt-change'>
<line><left>Change:</left>
<right>
<t t-esc="widget.format_currency(order.get_change())"/>
</right>
</line>
</div>
<!-- Footer -->
<t t-if='receipt.footer_xml'>
<t t-raw='receipt.footer_xml' />
</t>
<t t-if='!receipt.footer_xml and receipt.footer'>
<br/>
<t t-esc='receipt.footer' />
<br/>
<br/>
</t>
<div class="pos-center-align">
<t t-esc="order.formatted_validation_date"/>
<t t-if="widget.pos.config.iface_l10n_es_simplified_invoice and !order.is_to_invoice()">
<br/><span>Simplified invoice: </span>
</t>
<t t-esc="order.name"/>
</div>
</receipt>
</t>
</t>
</templates>

View file

@ -1,303 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="report_receipt_clientinfo" >
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<div class="pos-sale-ticket" style="padding: 0; margin: 0; font-size: 0.7em;">
<div class="pos-center-align"><img src="o.user_id.company_id.logo_web" width="100px" /></div>
<div class="pos-left-align"><t t-esc="o.user_id.company_id.name" /><br /></div>
<div class="pos-left-align"><t t-esc="o.user_id.company_id.street" /> - <t t-esc="o.user_id.company_id.city" /> - <t t-esc="o.user_id.company_id.zip" /><br /></div>
<div class="pos-left-align"><t t-esc="o.user_id.company_id.vat" /><br /></div>
<div class="receipt-phone pos-left-align">
Phone: <t t-esc="o.user_id.company_id.phone"/><br />
</div>
<br />
<div style="border-bottom: 1px dashed"></div>
<t t-if="o.partner_id">
<br/>
<!-- <span class="customer_title">Cooperativista: </span> <t t-esc="o.partner_id.barcode_base"/><br />-->
<div t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"]}' />
<t t-esc="o.partner_id.vat"/><br />
</t>
<!-- <t t-if="receipt.header">
<div style='text-align:center'>
<t t-esc="receipt.header" />
</div>
<br />
</t>-->
<div style="border-bottom: 1px dashed"></div>
<br />
<table width="100%" class='receipt-orderlines' >
<t t-foreach="o.lines" t-as="orderline">
<tr style="margin-top: 5px; font-size: 0.8em;">
<td colspan="4">
<t t-esc="orderline.product_id.name"/>
</td>
</tr>
<tr width="100%" style="font-size: 0.7em;">
<td></td>
<td class="pos-right-align" >
<t t-if="orderline.product_id.uom_id.name == 'Unidad(es)'">
<t t-esc="orderline.qty"/> Ud.
</t>
<t t-else="">
<t t-esc="orderline.qty"/>
</t>
</td>
<td class="pos-right-align">
<div>
x <t t-esc="orderline.price_unit"/>
</div>
</td>
<td class="pos-right-align">
<t t-esc="orderline.price_subtotal_incl"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-total'>
<tr style="font-size: 0.7em;">
<td>Subtotal:</td>
<td class="pos-right-align">
<t t-esc="o.amount_total - o.amount_tax"/>
</td>
</tr>
<!--<t t-foreach="o.get_tax_details()" t-as="taxdetail">
<tr>
<td><t t-esc="taxdetail.name" /></td>
<td class="pos-right-align">
<t t-esc="taxdetail.amount" />
</td>
</tr>
</t>-->
<!--<tr>
<t t-if="o.get_total_discount() > 0">
<td>Discount:</td>
<td class="pos-right-align">
<t t-esc="o.get_total_discount()"/>
</td>
</t>
</tr>
<t t-if="o.get_rounding_applied()">
<tr>
<td>Total:</td>
<td class="pos-right-align">
<t t-esc="widgetorder.get_total_with_tax()"/>
</td>
</tr>
<tr class="emph">
<td>Total Redondeado:</td>
<td class="pos-right-align">
<t t-esc='receipt.total_rounded' />
</td>
</tr>-->
<!--</t>-->
<!--<t t-else="">
<tr class="emph">
<td>Total:</td>
<td class="pos-right-align">
<t t-esc="widgetorder.get_total_with_tax()"/>
</td>
</tr>
</t>-->
</table>
<br />
<table class='receipt-paymentlines'>
<t t-foreach="paymentlines" t-as="line">
<tr>
<td>
<t t-esc="line.name"/>
</td>
<td class="pos-right-align">
<t t-esc="line.get_amount()"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-change'>
<tr style="font-size: 0.7em;"><td>Change:</td><td class="pos-right-align">
<t t-esc="o.amount_return"/>
</td></tr>
</table>
<!-- <t t-if="receipt.footer">
<br />
<div style='text-align:center'>
<t t-esc="receipt.footer" />
</div>
</t>-->
<br />
<div class="pos-center-align">
<t t-esc="o.date_order"/>
<!--<t t-if="widget.pos.config.iface_l10n_es_simplified_invoice">-->
<br/><span>Simplified invoice: </span>
<!--</t>-->
<t t-esc="o.name"/>
</div>
</div>
</t>
</t>
<!-- <t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<div class="pos-sale-ticket" style="padding-left: 18px; padding-right: 18px;">
<div class="pos-center-align"><img src="o.user_id.company_id.logo" height="70px" width="152px" /></div>
<h2 t-esc="o.user_id.company_id.name" />
<div t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "vat"], "no_marker": true, "phone_icons": true}' />
<div class="pos-left-align"><t t-esc="o.user_id.company_id.street" /> - <t t-esc="o.user_id.company_id.city" /> - <t t-esc="o.user_id.company_id.zip" /><br /></div>
<div class="pos-left-align"><t t-esc="o.user_id.company_id.vat" /><br /></div>
<div class="receipt-phone pos-left-align">
Phone: <t t-esc="o.user_id.company_id.phone"/><br />
</div>
<br />
<div style="border-bottom: 1px dashed"></div>-->
<!-- <t t-if="order.get_client()">-->
<!-- <br/>-->
<!-- <span class="customer_title">Cooperativista: </span> <t t-esc="order.get_client().barcode_base"/><br />-->
<!-- Name: <t t-esc="order.get_client().name"/><br />-->
<!-- </t>-->
<!-- <t t-if="receipt.header">-->
<!-- <div style='text-align:center'>-->
<!-- <t t-esc="receipt.header" />-->
<!-- </div>-->
<!-- <br />-->
<!-- </t>-->
<!-- <div style="border-bottom: 1px dashed"></div>-->
<!-- <br />-->
<!-- <table width="100%" class='receipt-orderlines' >-->
<!-- <t t-foreach="orderlines" t-as="orderline">-->
<!-- <tr style="margin-top: 5px;">-->
<!-- <td colspan="4">-->
<!-- <t t-esc="orderline.get_product().display_name"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr width="100%">-->
<!-- <td></td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-if="orderline.get_unit().name == 'Unidad(es)'">-->
<!-- <t t-esc="orderline.get_quantity()"/> Ud.-->
<!-- </t>-->
<!-- <t t-else="">-->
<!-- <t t-esc="orderline.get_quantity_str_with_unit()"/>-->
<!-- </t>-->
<!-- </td>-->
<!-- <td class="pos-right-align">-->
<!-- <div>-->
<!-- x <t t-esc="widget.format_currency(orderline.get_unit_display_price(), 'Product Price')"/>-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(orderline.get_display_price())"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </t>-->
<!-- </table>-->
<!-- <br />-->
<!-- <table class='receipt-total'>-->
<!-- <tr>-->
<!-- <td>Subtotal:</td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(order.get_total_without_tax())"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <t t-foreach="order.get_tax_details()" t-as="taxdetail">-->
<!-- <tr>-->
<!-- <td><t t-esc="taxdetail.name" /></td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(taxdetail.amount)" />-->
<!-- </td>-->
<!-- </tr>-->
<!-- </t>-->
<!-- <tr>-->
<!-- <td>Discount:</td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(order.get_total_discount())"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <t t-if="order.get_rounding_applied()">-->
<!-- <tr>-->
<!-- <td>Total:</td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(order.get_total_with_tax())"/>-->
<!-- </td>-->
<!-- </tr> -->
<!-- <tr class="emph">-->
<!-- <td>Total Redondeado:</td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc='widget.format_currency(receipt.total_rounded)' />-->
<!-- </td>-->
<!-- </tr>-->
<!-- </t>-->
<!-- <t t-else="">-->
<!-- <tr class="emph">-->
<!-- <td>Total:</td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(order.get_total_with_tax())"/>-->
<!-- </td>-->
<!-- </tr> -->
<!-- </t>-->
<!-- </table>-->
<!-- <br />-->
<!-- <table class='receipt-paymentlines'>-->
<!-- <t t-foreach="paymentlines" t-as="line">-->
<!-- <tr>-->
<!-- <td>-->
<!-- <t t-esc="line.name"/>-->
<!-- </td>-->
<!-- <td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(line.get_amount())"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </t>-->
<!-- </table>-->
<!-- <br />-->
<!-- <table class='receipt-change'>-->
<!-- <tr><td>Change:</td><td class="pos-right-align">-->
<!-- <t t-esc="widget.format_currency(order.get_change())"/>-->
<!-- </td></tr>-->
<!-- </table>-->
<!-- <t t-if="receipt.footer">-->
<!-- <br />-->
<!-- <div style='text-align:center'>-->
<!-- <t t-esc="receipt.footer" />-->
<!-- </div>-->
<!-- </t>-->
<!-- <br /> -->
<!-- <div class="pos-center-align">-->
<!-- <t t-esc="order.formatted_validation_date"/>-->
<!-- <t t-if="widget.pos.config.iface_l10n_es_simplified_invoice">-->
<!-- <br/><span>Simplified invoice: </span>-->
<!-- </t>-->
<!-- <t t-esc="order.name"/>-->
<!-- </div>-->
<!-- </div>
</t>
</t>-->
</template>
<record id="paperformat_posreceipt" model="report.paperformat">
<field name="name">Point Of Sale Receipt</field>
<field name="default" eval="True" />
<field name="format">custom</field>
<field name="page_height">150</field>
<field name="page_width">60</field>
<field name="orientation">Portrait</field>
<field name="margin_top">3</field>
<field name="margin_bottom">3</field>
<field name="margin_left">3</field>
<field name="margin_right">3</field>
<field name="header_line" eval="False" />
<field name="header_spacing">3</field>
<field name="dpi">130</field>
</record>
<report id="action_report_pos_receipt" string="Receipt"
model="pos.order" report_type="qweb-pdf"
name="pos_receipt_clientinfo.report_receipt_clientinfo" file="pos_receipt_clientinfo.report_receipt_clientinfo"
paperformat="pos_receipt_clientinfo.paperformat_posreceipt" />
</data>
</odoo>

View file

@ -1,24 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Pos Ticket Pricelist',
'description': """
Prints the pricelist applied on tickets.""",
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
"point_of_sale"
],
'data': [
],
'assets': {
'point_of_sale.assets': [
'pos_ticket_pricelist/static/src/xml/pos.xml'
],
},
'demo': [
],
}

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t
t-name="OrderReceipt"
t-inherit="point_of_sale.OrderReceipt"
t-inherit-mode="extension"
owl="1"
>
<xpath expr='//t[@t-if="receipt.cashier"]' position="after">
<t t-if="props.order.pricelist">
<t t-esc="props.order.pricelist.name" /><br />
</t>
</xpath>
<xpath expr='//t[@t-if="receipt.company.website"]' position="attributes">
<attribute name="t-att-class">{'oe_hidden': True}</attribute>
</xpath>
</t>
</templates>

View file

@ -3,7 +3,7 @@
{ {
'name': 'Product Category Default e-commerce Category', 'name': 'Product Category Default e-commerce Category',
'summary': "Set up default public categories based in internal category.", 'summary': "Set up website categories based in internal category.",
'version': "16.0.1.0.0", 'version': "16.0.1.0.0",
'author': "Criptomart", 'author': "Criptomart",
'website': 'https://criptomart.net', 'website': 'https://criptomart.net',

View file

@ -1,9 +1,5 @@
#import logging
from odoo import api, fields, models from odoo import api, fields, models
#_logger = logging.getLogger(__name__)
class ProductProduct(models.Model): class ProductProduct(models.Model):
_inherit = 'product.product' _inherit = 'product.product'
@ -25,16 +21,12 @@ class ProductProduct(models.Model):
if pub_cat: if pub_cat:
new_cats.append(pub_cat) new_cats.append(pub_cat)
vals['public_categ_ids'] = [[6,0,new_cats]] vals['public_categ_ids'] = [[6,0,new_cats]]
#vals['is_published'] = True
elif template_id: elif template_id:
template = self.env["product.template"].browse(template_id) template = self.env["product.template"].browse(template_id)
category = template.categ_id category = template.categ_id
pub_cat = self.get_category_public_category(category) pub_cat = self.get_category_public_category(category)
if pub_cat: if pub_cat:
template.public_categ_ids += pub_cat template.public_categ_ids += pub_cat
# autopublish
#if template.public_categ_id:
# template.is_published = True
return super().create(vals) return super().create(vals)

View file

@ -3,6 +3,7 @@
{ {
'name': 'Product Category Default PoS Category', 'name': 'Product Category Default PoS Category',
'summary': "Set up point of sale category based in internal category.",
'version': "16.0.1.0.0", 'version': "16.0.1.0.0",
'author': "Criptomart", 'author': "Criptomart",
'website': 'https://github.com/criptomart/obook', 'website': 'https://github.com/criptomart/obook',

View file

@ -2,7 +2,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Product Category Tax', 'name': 'Product Category Default Tax',
'summary': "Set up website categories based in internal category.",
'version': "16.0.1.0.0", 'version': "16.0.1.0.0",
'author': "Criptomart", 'author': "Criptomart",
'website': 'https://github.com/criptomart/obook', 'website': 'https://github.com/criptomart/obook',

View file

@ -1,56 +0,0 @@
=======================================
Product Update Price From Last Purchase
=======================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9a3d6dc2e0410212d91f0fba1627ece05131bc10535ebe1e51b03c5a7026f30d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github
:target: https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase
:alt: Criptomart/addons_cm
|badge1| |badge2| |badge3|
Update price from last purchase price, using product classification
margin
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/Criptomart/addons_cm/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/Criptomart/addons_cm/issues/new?body=module:%20product_update_price_last_purchase%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Criptomart
Maintainers
-----------
This module is part of the `Criptomart/addons_cm <https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase>`_ project on GitHub.
You are welcome to contribute.

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,27 +0,0 @@
{
"name": "Product Update Price From Last Purchase",
"version": "16.0.1.0.0",
"category": "purchase",
"summary": """"
Personaliza el comportamiento de Product para supermercados:
* Campo que guarda el último precio de compra en vez de usar standard_price
y no afectar a la valoración de inventario.
* Actualiza el precio de venta según el último precio de coste aplicado a una tarifa.
* Filtro para productos actualizados el último precio de coste.
* Filtro para productos que necesitan etiqueta nueva.
""",
"author": "Criptomart",
"website": "https://criptomart.net",
"license": "AGPL-3",
"depends": [
"account",
"stock_account",
"sale",
"product_margin_classification",
],
"data": [
"views/actions.xml",
"views/product_view.xml",
],
"installable": True,
}

View file

@ -1,282 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_update_price_last_purchase
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-28 17:11+0000\n"
"PO-Revision-Date: 2022-03-28 17:11+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price_automatic
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price_automatic
msgid "Automatic Sale Price"
msgstr "Precio de venta automático"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price_automatic
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price_automatic
msgid "Automatic computation of the PVP from the cost price and the rate defined in the configuration."
msgstr "Cálculo automático del PVP a partir del precio de coste y la tarifa definida en la configuración."
#. module: product_update_price_last_purchase
#: model:ir.actions.report,name:product_update_price_last_purchase.report_productbarcode
msgid "Barcode"
msgstr "Código de barras"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_pricelist_item__base
msgid "Base price for computation.\n"
"Public Price: The base price will be the Sale/public Price.\n"
"Cost Price : The base price will be the cost price.\n"
"Other Pricelist : Computation of the base price based on another Pricelist."
msgstr "Precio base de cálculo.\n"
"Precio Público: El precio base será el Precio Público / Venta.\n"
"Precio de costo: El precio base será el precio de costo.\n"
"Otra lista de precios: cálculo del precio base basado en otra lista de precios."
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_pricelist_item__base
msgid "Based on"
msgstr "Basado en"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price_compute_type
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price_compute_type
msgid "Choose whether discounts should influence the calculation of the last purchase price. Select Never update for manual configuration of cost and sale prices.\n"
"\n"
"* Without discounts: does not take into account discounts when updating the last purchase price.\n"
"* First discount: take into account only first discount when updating the last purchase price.\n"
"* Triple discount: take into account all discounts when updating the last purchase price. Needs \"Purchase Triple Discount\" OCA module.\n"
"* Manual update: Select this for manual configuration of cost and sale price. The sales price will not be calculated automatically."
msgstr "Elija si los descuentos deben influir en la actualización del último precio de compra. Seleccione No actualizar nunca para la configuración manual de los precios de coste y venta.\n"
"\n"
"* Sin descuentos: no tiene en cuenta ningún descuento al actualizar el último precio de compra.\n"
"* Primer descuento: tiene en cuenta sólo el primer descuento al actualizar el último precio de compra.\n"
"* Triple descuento: tiene en cuenta todos los descuentos al actualizar el último precio de compra. Necesita el módulo OCA \"Purchase Triple Discount\".\n"
"* Actualización manual: configuración manual del precio de coste y de venta. El precio de venta no se calculará automáticamente."
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_res_config_settings
msgid "Config Settings"
msgstr "Opciones de Configuración"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_packaging__qty
msgid "Contained Quantity"
msgstr "Cantidad contenida"
#. module: product_update_price_last_purchase
#: selection:product.pricelist.item,base:0
msgid "Cost"
msgstr "Coste"
#. module: product_update_price_last_purchase
#: selection:product.pricelist.item,base:0
msgid "Cost Price Tax Included"
msgstr "Precio de coste con impuesto incluido"
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.res_config_settings_view_form_pricelists
msgid "Default pricelists for Coops"
msgstr "Tarifas por defecto para cooperativas"
#. module: product_update_price_last_purchase
#: selection:product.template,last_purchase_price_compute_type:0
msgid "First discount"
msgstr "Primer descuento"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.product_view_inherit_list_price_auto
#: selection:product.pricelist.item,base:0
msgid "Last purchase price"
msgstr "Último precio de compra"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price_compute_type
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price_compute_type
msgid "Last purchase price calculation type"
msgstr "Cálculo de último precio de compra"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price_updated
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price_updated
msgid "Last purchase price updated"
msgstr "Último precio de compra actualizado"
#. module: product_update_price_last_purchase
#: selection:product.template,last_purchase_price_compute_type:0
msgid "Manual update"
msgstr "Actualización manual"
#. module: product_update_price_last_purchase
#: code:addons/product_update_price_last_purchase/models/product_template.py:38
#, python-format
msgid "Not found a valid pricelist to compute sale price. Check configuration in General Settings."
msgstr ""
#. module: product_update_price_last_purchase
#: selection:product.pricelist.item,base:0
msgid "Other Pricelist"
msgstr "Otra tarifa"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price
msgid "Price calculated according to the configured pricelist, including VAT."
msgstr "Precio calculado según la tarifa configurada, incluyendo el IVA."
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_product_pricelist
msgid "Pricelist"
msgstr "Tarifa"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_product_pricelist_item
msgid "Pricelist Item"
msgstr "Elemento de tarifa"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_res_config_settings__product_pricelist_automatic
msgid "Pricelist applied to automatic calculation of sales price"
msgstr "Tarifa aplicada al cálculo automático del precio de venta"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_res_company__product_pricelist_automatic
msgid "Pricelist applied to the automatic selling price"
msgstr "Tarifa aplicada al PVP automáticamente"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_product_product
msgid "Product"
msgstr "Producto"
#. module: product_update_price_last_purchase
#: model:ir.actions.report,name:product_update_price_last_purchase.report_product_product_barcode
#: model:ir.actions.report,name:product_update_price_last_purchase.report_product_template_barcode
#: model:ir.actions.report,name:product_update_price_last_purchase.report_productbarcode_laosa
#: model:ir.actions.report,name:product_update_price_last_purchase.report_simple_barcode_laosa
msgid "Product Barcode (PDF)"
msgstr "Código de barras del producto (PDF)"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_product_packaging
msgid "Product Packaging"
msgstr "Empaquetado del producto"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_tags
msgid "Products that have changed their sales price and no label has been printed."
msgstr "Productos que han cambiado su PVP y no se ha impreso su etiqueta."
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
msgid "Products that have recently changed their cost price and have not updated their selling price."
msgstr "Productos que han cambiado recientemente su precio de coste y no han actualizado su PVP."
#. module: product_update_price_last_purchase
#: selection:product.pricelist.item,base:0
msgid "Public Price"
msgstr "Precio público"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_res_company__product_pricelist_automatic
#: model:ir.model.fields,help:product_update_price_last_purchase.field_res_config_settings__product_pricelist_automatic
msgid "Rate that applies to all products that update the selling price automatically."
msgstr "Tarifa que se aplica a todos los productos que actualizan el precio de venta automáticamente."
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_ir_actions_report
msgid "Report Action"
msgstr "Reportar la acción"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price
msgid "Sale price with VAT"
msgstr "PVP con impuestos"
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.product_view_inherit_list_price_auto
msgid "Sale price."
msgstr "PVP"
#. module: product_update_price_last_purchase
#: model:ir.model,name:product_update_price_last_purchase.model_stock_move
msgid "Stock Move"
msgstr "Movimiento de stock"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price_updated
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price_updated
msgid "The last cost price has been updated and you need to update the selling price in the database, shelves and scales."
msgstr "Se ha actualizado el último precio de coste y hay que actualizar el PVP en la base de datos, lineales y las balanzas."
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price
msgid "The last price at which the product was purchased. It is used as the base price field for calculating the product sale price."
msgstr "El último precio al que se compró el producto. Se utiliza como campo de precio base para calcular el precio de venta del producto."
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__to_print
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__to_print
msgid "The sale price has been updated on this product and needs to be updated on the shelf."
msgstr "El PVP ha sido actualizado en este producto y necesita ser actualizado en el lineal."
#. module: product_update_price_last_purchase
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_packaging__qty
msgid "The total number of products you can have per pallet or box."
msgstr "El numero total de productos que puede tener por palé o caja."
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_tags
msgid "To print"
msgstr "Para imprimir"
#. module: product_update_price_last_purchase
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__to_print
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__to_print
msgid "To print label"
msgstr "Pendiente de imprimir etiqueta"
#. module: product_update_price_last_purchase
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
msgid "To update sales price"
msgstr "Pendiente de actualizar PVP"
#. module: product_update_price_last_purchase
#: selection:product.template,last_purchase_price_compute_type:0
msgid "Triple discount"
msgstr "Triple decuento"
#. module: product_update_price_last_purchase
#: model:ir.actions.server,name:product_update_price_last_purchase.action_product_calculate_theoritical_price
msgid "Update Sales Price"
msgstr "Actualizar PVP"
#. module: product_update_price_last_purchase
#: selection:product.template,last_purchase_price_compute_type:0
msgid "Without discounts"
msgstr "Sin descuentos"

View file

@ -1,3 +0,0 @@
from . import product_template
from . import product_product
from . import stock_move

View file

@ -1,57 +0,0 @@
# Copyright (C) 2020: Criptomart (https://criptomart.net)
# @author Santi Noreña (<santi@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class ProductProduct(models.Model):
_inherit = "product.product"
@api.depends(
"standard_price",
"last_purchase_price_received",
"lst_price",
"margin_classification_id",
"margin_classification_id.markup",
"margin_classification_id.price_round",
"margin_classification_id.price_surcharge",
"product_tmpl_id.taxes_id",
"product_tmpl_id.list_price",
)
def _compute_theoretical_multi(self):
res = super()._compute_theoretical_multi()
for product in self:
if product.last_purchase_price_received != 0:
(
product.margin_state,
product.theoretical_price,
product.theoretical_difference,
) = self._get_margin_info(
product.margin_classification_id,
product.taxes_id,
product.name,
product.last_purchase_price_received,
product.lst_price,
)
return res
def use_theoretical_price(self):
for product in self:
if product.last_purchase_price_received_compute_type != "manual_update":
product.lst_price = product.theoretical_price
product.to_print_label = True
class ProductPackaging(models.Model):
_inherit = "product.packaging"
qty = fields.Float(
"Contained Quantity",
help="The total number of products you can have per pallet or box.",
digits="Product Unit of Measure",
)

View file

@ -1,92 +0,0 @@
# Copyright (C) 2020: Criptomart (https://criptomart.net)
# @author Santi Noreña (<santi@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
MARGIN_STATE_SELECTION = [
("correct", "Correct Margin"),
("too_cheap", "Too Cheap"),
("too_expensive", "Too Expensive"),
]
class ProductTemplate(models.Model):
_inherit = "product.template"
margin_state = fields.Selection(
string="Theoretical Price State",
compute="_compute_theoretical_multi_template",
selection=MARGIN_STATE_SELECTION,
store=True,
)
to_print_label = fields.Boolean(
string="To print label",
help="""The sale price has been updated on this product
and needs to be updated on the shelf.""",
default=False,
)
last_purchase_price_received = fields.Float(
string="Last purchase price",
help="The last price at which the product was purchased. "
"It is used as the base price field for calculating the product sale price.",
readonly=True,
digits="Product Price",
)
last_purchase_price_received_compute_type = fields.Selection(
[
("without_discounts", "Without discounts"),
("with_discount", "First discount"),
("with_two_discounts", "Double discount"),
("with_three_discounts", "Triple discount"),
("manual_update", "Manual update"),
],
string="Last purchase price calculation type",
help="""
Choose whether discounts should influence the calculation of the last purchase price.
Select Never update for manual configuration of cost and sale prices.\n
* Without discounts: does not take into account discounts when updating
the last purchase price.\n
* First discount: take into account only first discount when updating
the last purchase price.\n
* Double discount: take into account two first discounts when updating
the last purchase price.\n
* Triple discount: take into account all discounts when updating
the last purchase price.
Needs "Purchase Triple Discount" OCA module.\n
* Manual update: Select this for manual configuration of cost and sale price.
The sales price will not be calculated automatically.
""",
default="without_discounts",
required=True,
)
@api.onchange(
"last_purchase_price_received",
"standard_price",
"taxes_id",
"margin_classification_id",
"list_price",
)
def _onchange_standard_price(self):
res = super()._onchange_standard_price()
if self.last_purchase_price_received != 0:
(
self.margin_state,
self.theoretical_price,
self.theoretical_difference,
) = self.env["product.product"]._get_margin_info(
self.margin_classification_id,
self.taxes_id,
self.name,
self.last_purchase_price_received,
self.list_price,
)
return res

View file

@ -1,71 +0,0 @@
# Copyright 2016-2019 Akretion (http://www.akretion.com/)
# Copyright 2020 Criptomart <tech@criptomart.net>
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# @author Santi Noreña (<santi@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import models
from odoo.tools import float_compare, float_is_zero, float_round
_logger = logging.getLogger(__name__)
class StockMove(models.Model):
_inherit = "stock.move"
def product_price_update_before_done(self):
res = super(StockMove, self).product_price_update_before_done()
for move in self.filtered(lambda move: move.location_id.usage == "supplier"):
if (
move.product_id.last_purchase_price_received_compute_type
== "with_three_discounts"
):
price_updated = float_round(
move.purchase_line_id.price_subtotal
/ move.purchase_line_id.product_qty,
precision_digits=2,
)
elif (
move.product_id.last_purchase_price_received_compute_type
== "with_discount"
):
price_updated = float_round(
move.purchase_line_id.price_unit
* (1 - move.purchase_line_id.discount / 100),
precision_digits=2,
)
elif (
move.product_id.last_purchase_price_received_compute_type
== "with_two_discounts"
):
price_updated = float_round(
move.purchase_line_id.price_unit
* (1 - move.purchase_line_id.discount / 100)
* (1 - move.purchase_line_id.discount2 / 100),
precision_digits=2,
)
else:
price_updated = move.purchase_line_id.price_unit
if float_compare(
move.product_id.last_purchase_price_received,
price_updated,
precision_digits=2,
) and not float_is_zero(move.quantity_done, precision_digits=3):
_logger.info(
"Update last_purchase_price_received: %s for product %s Previous price: %s"
% (
price_updated,
move.product_id.default_code,
move.product_id.last_purchase_price_received,
)
)
# Write last purchase price as SUPERUSER_ID
# warehouse manager may not have the right to write on products
move.product_id.with_company(move.company_id.id).sudo().write(
{"last_purchase_price_received": price_updated}
)
return res

View file

@ -1,2 +0,0 @@
Update price from last purchase price, using product classification
margin

View file

@ -1,409 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Product Update Price From Last Purchase</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="product-update-price-from-last-purchase">
<h1 class="title">Product Update Price From Last Purchase</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9a3d6dc2e0410212d91f0fba1627ece05131bc10535ebe1e51b03c5a7026f30d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase"><img alt="Criptomart/addons_cm" src="https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github" /></a></p>
<p>Update price from last purchase price, using product classification
margin</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-4">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/Criptomart/addons_cm/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/Criptomart/addons_cm/issues/new?body=module:%20product_update_price_last_purchase%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Criptomart</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase">Criptomart/addons_cm</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,36 +0,0 @@
<?xml version="1.0" ?>
<!--
Copyright (C) 2020-Today: La Osa (<https://laosa.coop/>)
@author: Criptomart (https://criptomart.net)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<!-- Add action entry in the Action Menu for calculate sale price in Products -->
<record id="action_product_calculate_theoritical_price" model="ir.actions.server">
<field name="name">Update Sales Price</field>
<field name="model_id" ref="product.model_product_template" />
<field name="binding_model_id" ref="product.model_product_template" />
<field name="state">code</field>
<field name="code">
records.use_theoretical_price()
</field>
</record>
<!-- Open products window with filter
<record id="action_product_template_list_price_updated" model="ir.actions.act_window">
<field name="name">Productos con PVP actualizable</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="product.product_template_tree_view"/>
<field name="domain">[]</field>
<field name="context">{"search_default_products_updated_filter": 1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Todos los productos están actualizados.
</p>
</field>
</record>
-->
</odoo>

View file

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<!-- list automatic price tick in product sheet -->
<record model="ir.ui.view" id="product_view_inherit_list_price_auto">
<field name="name">product.list.price.automatic.form</field>
<field name="model">product.template</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<label for="list_price" position="before">
<field name="last_purchase_price_received" />
<!-- attrs="{'readonly': 1}"-->
<!-- />-->
<field name="last_purchase_price_received_compute_type" />
<field name="to_print_label" />
</label>
<field name="standard_price" position="replace">
<field
name="standard_price"
attrs="{'readonly': [('last_purchase_price_received_compute_type','!=', 'manual_update')]}"
/>
</field>
</field>
</record>
<record id="product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.product.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view" />
<field name="arch" type="xml">
<field name="standard_price" position="after">
<field name="last_purchase_price_received" />
<field name="margin_state" invisible="1" />
</field>
</field>
</record>
<!--Filter for products that should update its sales price -->
<record id="view_product_search_form_inherit_updated" model="ir.ui.view">
<field name="name">view.product.search.form.inherit.updated</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="arch" type="xml">
<xpath expr="//filter[@name='services']" position="before">
<filter
string="To update sales price"
name="products_updated_filter"
domain="[
('last_purchase_price_received_compute_type', '!=', 'manual_update'),
('margin_state','in', ['too_cheap', 'too_expensive'])
]"
/>
<filter
string="To print"
name="products_ready_to_print_filter"
domain="[('to_print_label', '=', True)]"
/>
<separator />
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -1,75 +0,0 @@
====================
Collective Purchases
====================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3de867dc126c0b86e4d1cf5583f6823d92094851b21e228b2b364b2d444f2ce1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github
:target: https://github.com/Criptomart/addons_cm/tree/16.0/purchase_collective
:alt: Criptomart/addons_cm
|badge1| |badge2| |badge3|
Compras Colectivas
------------------
Éste módulo permite a varios usuarios de Odoo realizar una compra de
productos a un mismo proveedor que acepta pedidos conjuntos. El Usuario
que crea la orden es el encargado de distribuir los productos al resto
de usuarios, cobrar de ellos y pagar al productor.
- modelo CollectivePurchases, con un campo que linka diferentes sales
orders
- crea un único albarán de salida al proveedor con la suma de todas las
sale orders
- cuando se recibe el cargamente del proveedor, una acción permite
crear albaranes de entrega a los almacenes dde los nodo --> ¿poner en
un módulo aparte y quitar la dependencia a network_partner?
- nueva secuencia para collective order purchase
- workflow propio, por añadir los estados de entrega en subalmacén y
entrega al cliente.
- reglas de seguridad y grupos.
- extiende partner.network añadiendo un nuevo almacén que hace posible
el flujo.
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/Criptomart/addons_cm/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/Criptomart/addons_cm/issues/new?body=module:%20purchase_collective%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Criptomart
Maintainers
-----------
This module is part of the `Criptomart/addons_cm <https://github.com/Criptomart/addons_cm/tree/16.0/purchase_collective>`_ project on GitHub.
You are welcome to contribute.

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,26 +0,0 @@
{
"name": "Collective Purchases",
"summary": "Compras Colectivas",
"author": "Criptomart",
"website": "https://criptomart.net",
"category": "Purchase Management",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": ["purchase", "sale", "product", "network_partner"],
"data": [
"security/purchase_collective_security.xml",
"security/ir.model.access.csv",
# 'data/purchase_collective_workflow.xml',
# 'data/purchase_collective_sequence.xml',
"views/purchase_collective.xml",
"views/sale_order.xml",
"views/actions.xml",
"views/menus.xml",
"views/partner_node_views.xml",
"views/partner_net_views.xml",
],
"demo": [],
"installable": True,
"auto_install": False,
"application": False,
}

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Sequences for purchase.collective.order -->
<record id="seq_type_purchase_order" model="ir.sequence.type">
<field name="name">Collective Purchase Order</field>
<field name="code">purchase.collective.order</field>
</record>
<record id="seq_purchase_order" model="ir.sequence">
<field name="name">Collective Purchase Order</field>
<field name="code">purchase.collective.order</field>
<field name="prefix">CPO</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
</data>
</odoo>

View file

@ -1,240 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="purchase_collective_order" model="workflow">
<field name="name">Collective Purchase Order Basic Workflow</field>
<field name="osv">purchase.collective.order</field>
<field name="on_create">True</field>
</record>
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
<record id="act_sent" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">sent</field>
<field name="kind">function</field>
<field name="action">write({'state':'sent'})</field>
</record>
<record id="act_bid" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">bid</field>
<field name="kind">function</field>
<field name="action">wkf_bid_received()</field>
</record>
<record id="act_confirmed" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">confirmed</field>
<field name="split_mode">OR</field>
<field name="kind">function</field>
<field name="action">wkf_confirm_order()</field>
</record>
<record id="act_cancel" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">cancel</field>
<field name="kind">function</field>
<field name="flow_stop">True</field>
<field name="action">wkf_action_cancel()</field>
</record>
<record id="act_except_invoice" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">except_invoice</field>
<field name="kind">function</field>
<field name="action">write({'state':'except_invoice'})</field>
</record>
<record id="act_except_picking" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">except_picking</field>
<field name="kind">function</field>
<field name="action">write({'state':'except_picking'})</field>
</record>
<record id="act_router" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">router</field>
<field name="split_mode">OR</field>
<field name="kind">function</field>
<field name="join_mode">AND</field>
<field name="action">wkf_approve_order()</field>
</record>
<record id="act_invoice" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">invoice</field>
<field name="kind">subflow</field>
<field name="subflow_id" search="[('osv','=','account.invoice')]"/>
<field name="action">action_invoice_create()</field>
</record>
<record id="act_invoice_done" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">invoice_done</field>
<field name="action">invoice_done()</field>
<field name="kind">function</field>
</record>
<record id="act_invoice_end" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">invoice_end</field>
</record>
<record id="act_picking" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">picking</field>
<field name="kind">function</field>
<field name="action">action_picking_create()</field>
</record>
<record id="act_picking_done" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">picking_done</field>
<field name="action">picking_done()</field>
<field name="kind">function</field>
</record>
<record id="act_done" model="workflow.activity">
<field name="wkf_id" ref="purchase_collective_order"/>
<field name="name">done</field>
<field name="action">wkf_po_done()</field>
<field name="kind">function</field>
<field name="flow_stop">True</field>
<field name="join_mode">AND</field>
</record>
<record id="trans_draft_confirmed" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirmed"/>
<field name="signal">purchase_confirm</field>
</record>
<record id="trans_draft_sent" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_sent"/>
<field name="signal">send_rfq</field>
</record>
<record id="trans_bid_confirmed" model="workflow.transition">
<field name="act_from" ref="act_bid"/>
<field name="act_to" ref="act_confirmed"/>
<field name="signal">purchase_confirm</field>
</record>
<record id="trans_sent_bid" model="workflow.transition">
<field name="act_from" ref="act_sent"/>
<field name="act_to" ref="act_bid"/>
<field name="signal">bid_received</field>
</record>
<record id="trans_sent_cancel" model="workflow.transition">
<field name="act_from" ref="act_sent"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_bid_cancel" model="workflow.transition">
<field name="act_from" ref="act_bid"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_confirmed_cancel" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_draft_cancel" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_confirmed_router" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_router"/>
<!-- <field name="signal">purchase_approve</field> removed from simplification/useability -->
</record>
<record id="trans_router_picking" model="workflow.transition">
<field name="act_from" ref="act_router"/>
<field name="act_to" ref="act_picking"/>
<field name="condition">has_stockable_product()</field>
</record>
<record id="trans_router_picking_done" model="workflow.transition">
<field name="act_from" ref="act_router"/>
<field name="act_to" ref="act_picking_done"/>
<field name="condition">not has_stockable_product()</field>
</record>
<record id="trans_router_invoice" model="workflow.transition">
<field name="act_from" ref="act_router"/>
<field name="act_to" ref="act_invoice"/>
<field name="condition">invoice_method=='order'</field>
</record>
<record id="trans_router_invoice_no_order" model="workflow.transition">
<field name="act_from" ref="act_router"/>
<field name="act_to" ref="act_invoice_end"/>
<field name="condition">invoice_method&lt;&gt;'order'</field>
</record>
<record id="trans_except_picking_picking_done" model="workflow.transition">
<field name="act_from" ref="act_except_picking"/>
<field name="act_to" ref="act_picking_done"/>
<field name="signal">picking_ok</field>
</record>
<record id="trans_except_invoice_invoice_done" model="workflow.transition">
<field name="act_from" ref="act_except_invoice"/>
<field name="act_to" ref="act_invoice_done"/>
<field name="signal">invoice_ok</field>
</record>
<record id="trans_except_picking" model="workflow.transition">
<field name="act_from" ref="act_except_picking"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_except_invoice" model="workflow.transition">
<field name="act_from" ref="act_except_invoice"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
</record>
<record id="trans_picking_except_picking" model="workflow.transition">
<field name="act_from" ref="act_picking"/>
<field name="act_to" ref="act_except_picking"/>
<field name="signal">picking_cancel</field>
</record>
<record id="trans_invoice_except_invoice" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_except_invoice"/>
<field name="signal">subflow.cancel</field>
</record>
<record id="trans_picking_picking_done" model="workflow.transition">
<field name="act_from" ref="act_picking"/>
<field name="act_to" ref="act_picking_done"/>
<field name="signal">picking_done</field>
</record>
<record id="trans_invoice_invoice_done" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_invoice_done"/>
<field name="signal">subflow.paid</field>
</record>
<record id="trans_picking_done_done" model="workflow.transition">
<field name="act_from" ref="act_picking_done"/>
<field name="act_to" ref="act_done"/>
</record>
<record id="trans_invoice_done_done" model="workflow.transition">
<field name="act_from" ref="act_invoice_done"/>
<field name="act_to" ref="act_invoice_end"/>
</record>
<record id="trans_invoice_end_done" model="workflow.transition">
<field name="act_from" ref="act_invoice_end"/>
<field name="act_to" ref="act_done"/>
<field name="condition">invoiced</field>
</record>
<record id="trans_invoice_end_cancel" model="workflow.transition">
<field name="act_from" ref="act_invoice_end"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">purchase_cancel</field>
<field name="condition">invoice_method&lt;&gt;'order'</field>
</record>
</data>
</odoo>

View file

@ -1,4 +0,0 @@
from . import purchase_collective
from . import sale_order
from . import partner_node
from . import partner_network

View file

@ -1,25 +0,0 @@
# Copyright (C) 2022: Criptomart (<https://criptomart.net/>)
# @author: Criptomart (<tech@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
#import logging
from odoo import models, fields, api
#from odoo.exceptions import ValidationError, Warning
#_logger = logging.getLogger(__name__)
class PartnerNetwork(models.Model):
_inherit = 'partner.network'
wh_id = fields.Many2one('stock.warehouse', string="Almacén asociado", help='El almacén central donde recibe productos la red y se redistribuye a los nodos.')
@api.model
def create(self, vals):
if vals.get('wh_id', False) == False:
vals['wh_id'] = self.env['stock.warehouse'].create({
'name': vals.get('name'),
'code': vals.get('name')[4:]
}).id
return super().create(vals)

View file

@ -1,25 +0,0 @@
# Copyright (C) 2022: Criptomart (<https://criptomart.net/>)
# @author: Criptomart (<tech@criptomart.net>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
#import logging
from odoo import models, fields, api
#from odoo.exceptions import ValidationError, Warning
#_logger = logging.getLogger(__name__)
class PartnerNode(models.Model):
_inherit = 'partner.node'
wh_id = fields.Many2one('stock.warehouse', string="Almacén asociado", help='El almacén donde recibe productos el nodo y los manda a los socios finales.')
@api.model
def create(self, vals):
if vals.get('wh_id', False) == False:
vals['wh_id'] = self.env['stock.warehouse'].create({
'name': vals.get('name'),
'code': vals.get('name')[4:]
}).id
return super().create(vals)

View file

@ -1,251 +0,0 @@
import pytz
import logging
from datetime import datetime
from dateutil.relativedelta import relativedelta
from operator import attrgetter
from odoo import models, fields, api, osv, _
from odoo.exceptions import Warning
from odoo.tools.safe_eval import safe_eval as eval
_logger = logging.getLogger(__name__)
class PurchaseCollectiveOrder(models.Model):
_name = 'purchase_collective.order'
_inherit = ['purchase.order']
_description = 'Collective Purchases'
sales_order_lines = fields.One2many('sale.order','cp_order_id','Collective Order Lines',states={'approved':[('readonly',True)],'done':[('readonly',True)]},copy=True )
deadline_date = fields.Date(string='Order Deadline', required=True, help="End date of the order. Place your orders before this date")
amount_untaxed = fields.Float('Amount untaxed')
amount_tax = fields.Float('Taxes')
amount_total = fields.Float('Amount Total')
wh_id = fields.Many2one('stock.warehouse',string="Almacén asociado",help="El almacén central de distribución.")
qty_min =fields.Float('Cantidad mínima del pedido', required=True, help='Cantidad mínima del pedido requerida para ejecutar la orden de compra')
#@api.onchange('sales_order_lines')
def onchange_order_line(self, args=None):
_logger.info("onchange_order_lines -- args: %s" %(args))
res = {
'amount_untaxed': 0.0,
'amount_tax': 0.0,
'amount_total': 0.0,
}
val = val1 = 0.0
order_list = self.sales_order_lines
#_logger.info("order %s " %order.id)
val_tax = 0.0
val_untax = 0.0
if order_list:
cur = self.pricelist_id.currency_id
for line in order.sales_order_lines:
if line.state in ['done','approved']:
val += line.amount_total
#val_tax += val.get('amount_tax',0.0)
#val_untax += val.get('amount_untaxed',0.0)
res['amount_tax'] = cur.round(val_tax)
res['amount_untaxed'] = val
res['amount_total']= val
#_logger.info("Res : %s " %res)
order.write({'amount_untaxed': res['amount_untaxed']})
order.write({'amount_tax': res['amount_tax']})
order.write({'amount_total': res['amount_total']})
_logger.info("res : %s" %(res))
_logger.warning("returning : %s" %res)
return res
def subscribe(self, partner):
self.message_subscribe(partner_ids=[(partner.id)])
self.message_post(body=("Order line created by %s" %(partner.name)))
def button_details(self):
context = self.env.context.copy()
view_id = self.env.ref(
'sale.'
'view_order_form').id
context['default_is_cp'] = True
context['default_cp_order_id'] = self.id
context['supplier'] = self.partner_id
#context['default_partner_id'] = self.partner_id.id
context['default_pricelist_id'] = self.pricelist_id.id
context['default_order_date'] = self.date_order
context['default_date_planned'] = self.deadline_date
context['view_buttons'] = True
#context['fiscal_position'] = self.fiscal_position
#context['state'] = self.state
#context['parent'] = self.id
#partial_id = self.pool.get("purchase.collective.order.line").create(context=context)
view = {
'name': _('Details'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'sale.order',
'view_id': view_id,
'type': 'ir.actions.act_window',
'target': 'new',
'readonly': False,
#'res_id': partial_id,
'context': context
}
return view
def _get_order(self, ids):
result = {}
for line in self.pool.get('sale.order').browse(ids):
result[line.id] = True
return result.keys()
"""
def create(self, vals=None):
_logger.warning("Creating order %s" %(vals))
if vals.get('name','/')=='/':
vals['name'] = self.env['ir.sequence'].get('purchase_collective.order', context=context) or '/'
if not vals.get('location_id'):
for user_obj in self.env['res.users'].browse(uid, context=context):
vals['location_id'] = user_obj.partner_id.property_stock_supplier.id
#logging.info('adding location info %s' %vals.get('location_id'))
if not vals.get('pricelist_id'):
for user_obj in self.env['res.users'].browse(uid, context=context):
vals['pricelist_id'] = user_obj.partner_id.property_product_pricelist.id
#logging.info('adding pricelist %s' %vals.get('pricelist_id'))
order = super(PurchaseCollectiveOrder, self).create(vals)
return order
"""
def unlink(self, ids):
purchase_orders = self.read(ids, ['state'], context=context)
unlink_ids = []
for s in purchase_orders:
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
raise Warning(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.'))
# automatically sending subflow.delete upon deletion
self.signal_workflow(unlink_ids, 'purchase_cancel')
return super(PurchaseCollectiveOrder, self).unlink(unlink_ids, context=context)
def copy(self, id, default=None, context=None):
new_id = super(PurchaseCollectiveOrder, self).copy(id, default=default, context=context)
for po in self.browse([new_id], context=context):
for line in po.order_line:
vals = self.env['purchase_collective.order_line'].onchange_product_id(
line.id, po.pricelist_id.id, line.product_id.id, line.product_qty,
line.product_uom.id, po.partner_id.id, date_order=po.date_order, context=context
)
if vals.get('value', {}).get('date_planned'):
line.write({'date_planned': vals['value']['date_planned']})
return new_id
def set_order_line_status(self, ids, status, context=None):
"""
line = self.pool.get('purchase_collective.order_line')
order_line_ids = []
proc_obj = self.pool.get('procurement.order')
for order in self.browse(cr, uid, ids, context=context):
if status in ('draft', 'cancel'):
order_line_ids += [po_line.id for po_line in order.order_line]
else: # Do not change the status of already cancelled lines
order_line_ids += [po_line.id for po_line in order.order_line if po_line.state != 'cancel']
if order_line_ids:
line.write(cr, uid, order_line_ids, {'state': status}, context=context)
if order_line_ids and status == 'cancel':
procs = proc_obj.search(cr, uid, [('purchase_line_id', 'in', order_line_ids)], context=context)
if procs:
proc_obj.write(cr, uid, procs, {'state': 'exception'}, context=context)
"""
return True
def wkf_confirm_order(self, ids, context=None):
#_logger.info("Confirmando orden : %s" %ids)
todo = []
for po in self.browse(ids, context=context):
if not any(line.state != 'cancel' for line in po.order_line):
raise Warning(_('Error!'),_('You cannot confirm a purchase order without any purchase order line.'))
#if po.invoice_method == 'picking' and not any([l.product_id and l.product_id.type in ('product', 'consu') and l.state != 'cancel' for l in po.order_line]):
# raise osv.except_osv(
# _('Error!'),
# _("You cannot confirm a purchase order with Invoice Control Method 'Based on incoming shipments' that doesn't contain any stockable item."))
#for line in po.order_line:
# if line.state=='draft':
# todo.append(line.id)
#self.pool.get('purchase_collective.order_line').action_confirm(cr, uid, todo, context)
for id in ids:
self.write(id, {'state' : 'confirmed', 'validator' : uid}, context=context)
return True
def _set_po_lines_invoiced(self, ids, context=None):
"""
for po in self.browse(cr, uid, ids, context=context):
is_invoiced = []
if po.invoice_method == 'picking':
# We determine the invoiced state of the PO line based on the invoiced state
# of the associated moves. This should cover all possible cases:
# - all moves are done and invoiced
# - a PO line is split into multiple moves (e.g. if multiple pickings): some
# pickings are done, some are in progress, some are cancelled
for po_line in po.order_line:
if (po_line.move_ids and
all(move.state in ('done', 'cancel') for move in po_line.move_ids) and
not all(move.state == 'cancel' for move in po_line.move_ids) and
all(move.invoice_state == 'invoiced' for move in po_line.move_ids if move.state == 'done')
and po_line.invoice_lines and all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines)):
is_invoiced.append(po_line.id)
elif po_line.product_id.type == 'service':
is_invoiced.append(po_line.id)
else:
for po_line in po.order_line:
if (po_line.invoice_lines and
all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines)):
is_invoiced.append(po_line.id)
if is_invoiced:
self.pool['purchase_collective.order_line'].write(cr, uid, is_invoiced, {'invoiced': True})
workflow.trg_write(uid, 'purchase_colective.order', po.id, cr)
"""
def action_picking_create(self, ids, context=None):
for order in self.browse(ids):
picking_vals = {
'picking_type_id': order.picking_type_id.id,
'partner_id': order.partner_id.id,
'date': order.date_order,
'origin': order.name
}
picking_id = self.env['stock.picking'].create(picking_vals, context=context)
# esta llamada da fallo
#self._create_stock_moves(cr, uid, order, order.order_line, picking_id, context=context)
return picking_id
# get the picking type for the warehouse defined in order
def _get_picking_in(self, context=None):
type_obj = self.env['stock.picking.type']
types = type_obj.search([('code', '=', 'incoming'),('warehouse_id.id','=',self.wh_id.id)], context=context)
if not types:
types = type_obj.search(cr, uid, [('code', '=', 'incoming'), ('warehouse_id', '=', False)], context=context)
if not types:
raise Warning(_('Error!'), _("Make sure you have defined the warehouse in the order!"))
#logging.info("Types %s" %types)
return types[0]
_defaults = {
'date_order': fields.datetime.now,
'state': 'draft',
'name': '/',
'shipped': 0,
'invoice_method': 'order',
'invoiced': 0,
'picking_type_id': _get_picking_in,
}

View file

@ -1,22 +0,0 @@
import random
from odoo import models, api, fields
from odoo.exceptions import ValidationError, Warning
class SaleOrder(models.Model):
_inherit = "sale.order"
cp_order_id = fields.Many2one(
'purchase_collective.order',
string='Parent Collective Purchase',
help='The collective purchase wich this order belongs',
ondelete='restrict'
)
is_cp = fields.Boolean(string="Is part of a Collective Purchase")
def action_confirm(self):
for order in self:
order.warehouse_id = order.partner_id.node_id.wh_id
return super(SaleOrder, self).action_confirm()

View file

@ -1,4 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_purchase_collective_order_public,purchase_collective.order,model_purchase_collective_order,base.group_public,1,0,0,0
access_purchase_collective_order,purchase_collective.order,model_purchase_collective_order,group_purchase_collective_user,1,0,1,0
access_purchase_collective_order_manager,purchase_collective.order,model_purchase_collective_order,group_purchase_collective_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_purchase_collective_order_public purchase_collective.order model_purchase_collective_order base.group_public 1 0 0 0
3 access_purchase_collective_order purchase_collective.order model_purchase_collective_order group_purchase_collective_user 1 0 1 0
4 access_purchase_collective_order_manager purchase_collective.order model_purchase_collective_order group_purchase_collective_manager 1 1 1 1

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.module.category" id="module_category_purchase_collective_management">
<field name="name">Collective Purchase</field>
<field name="description">Make bulk purchases from several users</field>
<field name="sequence">20</field>
</record>
<record id="group_purchase_collective_user" model="res.groups">
<field name="name">User</field>
<field name="implied_ids" eval="[(4, ref('base.group_user')),(4,ref('purchase.group_purchase_user'))]"/>
<field name="category_id" ref="purchase_collective.module_category_purchase_collective_management"/>
</record>
<record id="group_purchase_collective_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="purchase_collective.module_category_purchase_collective_management"/>
<field name="implied_ids" eval="[(4, ref('group_purchase_collective_user')),(4,ref('purchase.group_purchase_manager'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record model="ir.rule" id="purchase_collective_order_all_rule">
<field name="name">Collective Purchase Order All Read</field>
<field name="model_id" ref="model_purchase_collective_order"/>
<field name="global" eval="False"/>
<field name="groups" eval="[(4,ref('purchase_collective.group_purchase_collective_user'))]"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.parent_id.id])]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="purchase_order_comp_rule">
<field name="name">Collective Purchase Order multi-company</field>
<field name="model_id" ref="model_purchase_collective_order"/>
<field name="global" eval="False"/>
<field name="domain_force">['|',('create_uid','=',False),('create_uid','=',user.id)]</field>
<field name="groups" eval="[(4,ref('purchase_collective.group_purchase_collective_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_create" eval="True"/>
</record>
</odoo>

View file

@ -1,425 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Collective Purchases</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="collective-purchases">
<h1 class="title">Collective Purchases</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3de867dc126c0b86e4d1cf5583f6823d92094851b21e228b2b364b2d444f2ce1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/Criptomart/addons_cm/tree/16.0/purchase_collective"><img alt="Criptomart/addons_cm" src="https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github" /></a></p>
<div class="section" id="compras-colectivas">
<h1>Compras Colectivas</h1>
<p>Éste módulo permite a varios usuarios de Odoo realizar una compra de
productos a un mismo proveedor que acepta pedidos conjuntos. El Usuario
que crea la orden es el encargado de distribuir los productos al resto
de usuarios, cobrar de ellos y pagar al productor.</p>
<ul class="simple">
<li>modelo CollectivePurchases, con un campo que linka diferentes sales
orders</li>
<li>crea un único albarán de salida al proveedor con la suma de todas las
sale orders</li>
<li>cuando se recibe el cargamente del proveedor, una acción permite
crear albaranes de entrega a los almacenes dde los nodo &gt; ¿poner en
un módulo aparte y quitar la dependencia a network_partner?</li>
<li>nueva secuencia para collective order purchase</li>
<li>workflow propio, por añadir los estados de entrega en subalmacén y
entrega al cliente.</li>
<li>reglas de seguridad y grupos.</li>
<li>extiende partner.network añadiendo un nuevo almacén que hace posible
el flujo.</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a></li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/Criptomart/addons_cm/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/Criptomart/addons_cm/issues/new?body=module:%20purchase_collective%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
</div>
</div>
<div class="section" id="authors">
<h1>Authors</h1>
<ul class="simple">
<li>Criptomart</li>
</ul>
</div>
<div class="section" id="maintainers">
<h1>Maintainers</h1>
<p>This module is part of the <a class="reference external" href="https://github.com/Criptomart/addons_cm/tree/16.0/purchase_collective">Criptomart/addons_cm</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</body>
</html>

View file

@ -1,53 +0,0 @@
<odoo>
<data>
<record id="action_purchase_collective_order_open" model="ir.actions.act_window">
<field name="name">Open</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase_collective.order</field>
<field name="view_mode">tree,form</field>
<field name="context">{
'search_default_my_sale_orders_filter': 1
}
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new Collective Purchase.
</p>
</field>
</record>
<record id="action_purchase_collective_order_confirmed" model="ir.actions.act_window">
<field name="name">Closed</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase_collective.order</field>
<field name="view_mode">tree,form</field>
<field name="context">{
'search_default_my_sale_orders_filter': 1
}
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new Collective Purchase.
</p>
</field>
</record>
<record id="action_purchase_collective_order_cancel" model="ir.actions.act_window">
<field name="name">Cancelled</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase_collective.order</field>
<field name="view_mode">tree,form</field>
<field name="context">{
'search_default_my_sale_orders_filter': 1
}
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new Collective Purchase.
</p>
</field>
</record>
</data>
</odoo>

View file

@ -1,25 +0,0 @@
<odoo>
<data>
<menuitem id="menu_purchase_collective_sub"
parent="network_partner.menu_network_partner_root"
name ="Collective Purchases"
sequence="20"
/>
<menuitem action="action_purchase_collective_order_open"
id="menu_purchase_collective_order_open"
parent="purchase_collective.menu_purchase_collective_sub"
sequence="10"
/>
<menuitem action="action_purchase_collective_order_confirmed"
id="menu_purchase_collective_order_confirmed"
parent="purchase_collective.menu_purchase_collective_sub"
sequence="20"
/>
<menuitem action="action_purchase_collective_order_cancel"
id="menu_purchase_collective_order_cancelled"
parent="purchase_collective.menu_purchase_collective_sub"
sequence="30"
/>
</data>
</odoo>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_partner_network_net_inherit_pc_form" model="ir.ui.view">
<field name="name">partner.net.form.wh.view</field>
<field name="model">partner.network</field>
<field name="inherit_id" ref="network_partner.view_partner_network_net_form"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="wh_id"/>
</field>
</field>
</record>
<record id="view_partner_network_net_inherit_pc_tree" model="ir.ui.view">
<field name="name">partner.net.tree.wh.view</field>
<field name="model">partner.network</field>
<field name="inherit_id" ref="network_partner.view_partner_network_net_tree"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="wh_id"/>
</field>
</field>
</record>
</data>
</odoo>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_partner_network_node_inherit_pc_form" model="ir.ui.view">
<field name="name">partner.node.form.wh.view</field>
<field name="model">partner.node</field>
<field name="inherit_id" ref="network_partner.view_partner_network_node_form"/>
<field name="arch" type="xml">
<field name="network_id" position="after">
<field name="wh_id"/>
</field>
</field>
</record>
<record id="view_partner_network_node_inherit_pc_tree" model="ir.ui.view">
<field name="name">partner.node.tree.wh.view</field>
<field name="model">partner.node</field>
<field name="inherit_id" ref="network_partner.view_partner_network_node_tree"/>
<field name="arch" type="xml">
<field name="network_id" position="after">
<field name="wh_id"/>
</field>
</field>
</record>
</data>
</odoo>

View file

@ -1,111 +0,0 @@
<odoo>
<data>
<record id="purchase_collective_order_form_view" model="ir.ui.view">
<field name="name">purchase.collective.order.form.view</field>
<field name="model">purchase_collective.order</field>
<field name="arch" type="xml">
<form string="Collective Purchase Order">
<header>
<button name="action_rfq_send" states="draft" string="Send by Email" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
<button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="button_confirm" type="object" states="sent" string="Confirm Order" class="oe_highlight" id="bid_confirm"/>
<button name="button_approve" type="object" states='to approve' string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="action_view_invoice" string="Create Bill" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"/>
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}"/>
<button name="print_quotation" string="Print RFQ" type="object" states="sent" groups="base.group_user"/>
<button name="button_confirm" type="object" states="draft" string="Confirm Order" id="draft_confirm"/>
<button name="action_rfq_send" states="purchase" string="Send PO by Email" type="object" context="{'send_rfq':False}"/>
<button name="action_view_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'not in', ('no', 'invoiced'))]}"/>
<button name="button_draft" states="cancel" string="Set to Draft" type="object" />
<button name="button_cancel" states="draft,to approve,sent,purchase" string="Cancel" type="object" />
<button name="button_done" type="object" string="Lock" states="purchase"/>
<button name="button_unlock" type="object" string="Unlock" states="done" groups="purchase.group_purchase_manager"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,purchase" readonly="1"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button type="object" name="action_view_invoice"
class="oe_stat_button"
icon="fa-pencil-square-o" attrs="{'invisible':['|', ('invoice_count', '=', 0), ('state', 'in', ('draft','sent','to approve'))]}">
<field name="invoice_count" widget="statinfo" string="Vendor Bills"/>
<field name='invoice_ids' invisible="1"/>
</button>
</div>
<div class="oe_title">
<span class="o_form_label" attrs="{'invisible': [('state','not in',('draft','sent'))]}">Request for Quotation </span>
<span class="o_form_label" attrs="{'invisible': [('state','in',('draft','sent'))]}">Purchase Order </span>
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="partner_id" widget="res_partner_many2one" context="{'search_default_supplier':1, 'default_supplier':1, 'default_customer':0, 'show_vat': True}" domain="[('supplier','=',True)]"
placeholder="Name, TIN, Email, or Reference"
/>
<field name="partner_ref"/>
<field name="currency_id" groups="base.group_multi_currency" force_save="1"/>
<field name="deadline_date" attrs="{'required': True}" />
<field name="qty_min" attrs="{'required': True }" />
<field name="wh_id"/>
</group>
<group>
<field name="date_order"/>
<field name="origin" attrs="{'invisible': [('origin','=',False)]}"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
</group>
<notebook>
<page string="Pedidos de ventas">
<field name="sales_order_lines">
<tree string="Collective Purchase Order Lines" editable="bottom">
<field name="name"/>
<field name="partner_id" string="Customer"/>
<field name="state" invisible='0'/>
<field name="amount_total"/>
<!--
<button name="button_manual_payment" string="Manual Payment" type="object"
context="{'purchase_collective_line' : True, 'order_line_id': id, 'create_uid' : create_uid}"
states="draft"
/>
-->
</tree>
</field>
</page>
<page string="Other Information" name="purchase_delivery_invoice">
<group>
<group>
<label for="date_planned"/>
<div>
<!-- Expected to be readonly at creation otherwise recompute will change the value anyway -->
<field name="date_planned" attrs="{'readonly': ['|', ('id', '=', False), ('state', 'not in', ('draft', 'sent'))]}"/>
<button name="action_set_date_planned" type="object"
states="draft,sent"
string="Set date to all order lines"
help="This changes the scheduled date of all order lines to the given date"
class="fa fa-calendar o_icon_button oe_edit_only"/>
</div>
</group>
<group>
<field name="user_id"/>
<field name="invoice_status"/>
<field name="payment_term_id" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/>
<field name="fiscal_position_id" options="{'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/>
<field name="date_approve" groups="base.group_no_one"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
</data>
</odoo>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_form_sale_order_cp" model="ir.ui.view">
<field name="name">sale order collective purchase extension</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="before" >
<group>
<field name="is_cp" string="Is Collective Purchase" help="Is part o a collective Purchase" groups="purchase_collective.group_purchase_collective_manager"/>
<field name="cp_order_id" string="Collective Purchase wich this order belogns" groups="purchase_collective.group_purchase_collective_manager"/>
</group>
</field>
</field>
</record>
</data>
</odoo>

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,21 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Stock Inventory Cost Info Sum',
'description': """
Extends the OCA module stock_inventory_cost_info to store in the Inventory model the sum of the cost information of the inventory lines. This allows exporting and filtering by this field in the inventory adjustments tree view without having to export each inventory line.""",
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
'stock_inventory_cost_info',
],
'data': [
'views/stock_inventory.xml',
'views/actions.xml',
],
'demo': [
],
}

View file

@ -1 +0,0 @@
from . import stock_inventory

View file

@ -1,26 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
class StockInventory(models.Model):
_inherit = 'stock.inventory'
currency_id = fields.Many2one(
string="Currency",
related="company_id.currency_id",
readonly=True,
)
adjustment_cost_sum = fields.Monetary(
string="Adjustment cost",
compute="_compute_adjustment_cost_sum",
store=True,
)
@api.depends("line_ids")
def _compute_adjustment_cost_sum(self):
for record in self:
record.adjustment_cost_sum = 0
for line in record.line_ids:
record.adjustment_cost_sum += line.adjustment_cost

View file

@ -1,14 +0,0 @@
<odoo>
<!-- Add action entry in the Action Menu for calculate adjustment cost in Inventories -->
<record id="action_product_calculate_theoritical_price2" model="ir.actions.server">
<field name="name">Recalculate Adjustment Cost</field>
<field name="model_id" ref="stock.model_stock_inventory"/>
<field name="binding_model_id" ref="stock.model_stock_inventory"/>
<field name="state">code</field>
<field name="code">
records._compute_adjustment_cost_sum()
</field>
</record>
</odoo>

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2022 Criptomart
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="stock_inventory_form_view">
<field name="name">stock.inventory.form (in stock_inventory_cost_info_sum)</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_form"/>
<field name="arch" type="xml">
<field name="date" position="after" >
<field name="adjustment_cost_sum"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="stock_inventory_tree_view">
<field name="name">stock.inventory.tree (in stock_inventory_cost_info_sum)</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_tree"/>
<field name="arch" type="xml">
<field name="state" position="after" >
<field name="currency_id" invisible="1"/>
<field name="adjustment_cost_sum" sum="Total" />
</field>
</field>
</record>
</odoo>

View file

@ -1 +0,0 @@
from . import models

View file

@ -1,20 +0,0 @@
# Copyright 2021 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Website Sale Product Sort Creation Date',
'summary': 'Permite ordenar por la fecha de creación de los productos.',
'version': "16.0.1.0.0",
'development_status': 'Beta',
'category': 'Website',
'website': 'https://github.com/criptomart/obook',
'author': 'Criptomart',
'license': 'AGPL-3',
'depends': [
'website',
'website_sale_product_sort',
],
'data': [
],
'application': False,
'installable': True,
}

View file

@ -1,2 +0,0 @@
from . import website

View file

@ -1,26 +0,0 @@
# Copyright 2021 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
class Website(models.Model):
_inherit = "website"
@api.model
def _get_product_sort_criterias(self):
return [
('website_sequence desc', _('Relevance')),
('list_price desc', _('Catalog price: High to Low')),
('list_price asc', _('Catalog price: Low to High')),
('name asc', _('Name - A to Z')),
('name desc', _('Name - Z to A')),
('create_date desc', 'Novedades'),
]
default_product_sort_criteria = fields.Selection(
selection='_get_product_sort_criterias',
string="Sort products by",
help="Default criteria for sorting products in the shop",
default='create_date desc',
required=True,
)

View file

@ -1,3 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import controllers
from . import models

View file

@ -1,23 +0,0 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Website Search Products',
'description': """
Allows portal users to search products in a table with filters.""",
'version': "16.0.1.0.0",
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
"stock",
"website"
],
'data': [
"data/menu.xml",
"data/ir_rule.xml",
"views/web_templates.xml"
],
'demo': [
],
}

View file

@ -1,3 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import controller

View file

@ -1,33 +0,0 @@
from odoo import http
from odoo.http import request
from odoo.addons.website.controllers.main import Website
import logging
_logger = logging.getLogger(__name__)
class IntentoryForm(http.Controller):
@http.route(['/inventory/search'], type='http', auth="user", website=True)
def inventory_form(self, **post):
if not request.env['res.users'].browse(request.uid).has_group('base.group_portal')\
and not request.env['res.users'].browse(request.uid).has_group('base.group_user'):
redirect = b'/web?'
return http.redirect_with_hash(redirect)
products = request.env["product.template"].search([('active', '=', 'True'), ('available_in_pos', '=', 'True')])
vals = {'products': products}
return request.render("website_search_products.web_list_products", vals)
class Website(Website):
@http.route(website=True, auth="public")
def web_login(self, redirect=None, *args, **kw):
response = super(Website, self).web_login(redirect=redirect, *args, **kw)
if not redirect and request.params['login_success']:
if request.env['res.users'].browse(request.uid).has_group('base.group_user'):
redirect = b'/web?' + request.httprequest.query_string
else:
redirect = '/inventory/search'
return http.redirect_with_hash(redirect)
return response

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="member_space_consult_products" model="ir.rule">
<field name="name">Portal Consult Products</field>
<field name="model_id" ref="product.model_product_template"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/>
<field eval="0" name="perm_unlink"/>
<field eval="1" name="active"/>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
</odoo>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="menu_partner_form" model="website.menu">
<field name="name">Products in Shop</field>
<field name="url">/inventory/search</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">22</field>
</record>
</data>
</odoo>

View file

@ -1,68 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_search_products
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-16 10:53+0000\n"
"PO-Revision-Date: 2023-01-16 12:07+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: es\n"
"X-Generator: Poedit 2.3\n"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Category"
msgstr "Categoría"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Displayed products"
msgstr "Productos mostrados"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "In this table you can consult all the products available in the store"
msgstr "En esta tabla puedes consultar los productos disponibles en tienda"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Name"
msgstr "Nombre"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Price"
msgstr "Precio"
#. module: website_search_products
#: model:website.menu,name:website_search_products.menu_partner_form
msgid "Products in Shop"
msgstr "Productos en tienda"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Products not found"
msgstr "Productos no encontrados"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Quantity"
msgstr "Cantidad"
#. module: website_search_products
#: model:ir.model,name:website_search_products.model_stock_move
msgid "Stock Move"
msgstr "Movimiento de stock"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "UoM"
msgstr "UdM"

View file

@ -1,67 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_search_products
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-16 10:53+0000\n"
"PO-Revision-Date: 2023-01-16 10:53+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Category"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Displayed products"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "In this table you can consult all the products available in the store"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Name"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Price"
msgstr ""
#. module: website_search_products
#: model:website.menu,name:website_search_products.menu_partner_form
msgid "Products in Shop"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Products not found"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "Quantity"
msgstr ""
#. module: website_search_products
#: model:ir.model,name:website_search_products.model_stock_move
msgid "Stock Move"
msgstr ""
#. module: website_search_products
#: model_terms:ir.ui.view,arch_db:website_search_products.web_list_products
msgid "UoM"
msgstr ""

View file

@ -1,2 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import stock_move

View file

@ -1,58 +0,0 @@
from odoo import tools
from odoo import models, fields, api
from datetime import date,datetime
from dateutil.relativedelta import relativedelta
import logging
_logger = logging.getLogger(__name__)
class StockMove(models.Model):
_inherit = 'stock.move'
def get_stock_moves_by_product(self, date_begin, date_end, location):
if date_begin and date_end:
moves = self.env['stock.move'].search([
'|',
('location_id','=',int(location)),
('location_dest_id','=',int(location)),
('state', '=', 'done'),
('date','>=',date_begin),
('date','<=',date_end),
])
else:
return []
moves_grouped = {}
data = []
if moves:
for move in moves:
if move.product_id.id and move.product_id.type == 'product':
if not moves_grouped.get(move.product_id.id, False):
date_end_obj = datetime.strptime(date_end, '%Y-%m-%d').date() + relativedelta(days=1)
moves_grouped[move.product_id.id] = dict([])
moves_grouped[move.product_id.id]['name'] = move.product_id.name
moves_grouped[move.product_id.id]['category'] = move.product_id.categ_id.name
moves_grouped[move.product_id.id]['list_price'] = move.product_id.list_price
moves_grouped[move.product_id.id]['qty_init'] = move.product_id.with_context({
'to_date':date_begin,
'location': int(location)
}).qty_available
moves_grouped[move.product_id.id]['qty_end'] = move.product_id.with_context({
'to_date':date_end_obj,
'location': int(location)
}).qty_available
if not moves_grouped[move.product_id.id].get('in'):
moves_grouped[move.product_id.id]['in'] = 0.0
if not moves_grouped[move.product_id.id].get('out'):
moves_grouped[move.product_id.id]['out'] = 0.0
if int(move.location_id) == int(location):
moves_grouped[move.product_id.id]['out'] += move.product_qty
elif int(move.location_dest_id) == int(location):
moves_grouped[move.product_id.id]['in'] += move.product_qty
data = list(moves_grouped.values())
return data

View file

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 Criptomart <tech@criptomart.net>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<template id="web_list_products" name="Product List">
<t t-call="website.layout">
<div id="wrap">
<div class="container">
<div class="col-md-12">
<t t-if="products">
<div class="alert alert-success">
Displayed products
</div>
</t>
<t t-if="not_found">
<div class="alert alert-danger">
Products not found
</div>
</t>
<div class="col-md-12" style="text-align: center;"><h2>In this table you can consult all the products available in the store</h2></div>
<div class="col-md-12" style="margin-top: 50px;">
<table id="productTable" class="table stripe" >
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Price</th>
<th>Quantity</th>
<th>UoM</th>
</tr>
</thead>
<tbody id="stockList" >
<t t-foreach="products" t-as="product">
<tr>
<td><span t-esc="product.name"/></td>
<td><span t-esc="product.categ_id.name"/></td>
<td><span t-esc="product.list_price" t-options='{"widget": "monetary", "display_currency": res_company.currency_id}' /></td>
<td><span t-esc="product.sudo().qty_available" t-options='{"widget": "float", "precision": 2}' /></td>
<td><span t-esc="product.sudo().uom_id.name" /></td>
</tr>
</t>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js" />
<script src="https://cdn.datatables.net/plug-ins/1.13.2/filtering/type-based/accent-neutralise.js" />
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css" />
<script>
$('#productTable').DataTable({
"pageLength": 100,
"order": [[1, "asc"], [0, "asc"], [2, "desc"]],
"language": {
"url": "https://cdn.datatables.net/plug-ins/1.13.1/i18n/es-ES.json"
}
});
</script>
</t>
</template>
</odoo>